var
a:array[0..200000]of longint;
b:array[0..200000]of boolean;
n,m,q,l,r:longint;
i,j,k:longint;
Procedure openn;
begin
assign(input,'stall.in'); assign(output,'stall.out');
reset(input); rewrite(output);
end;
Procedure closee;
begin
close(input); close(output);
end;
begin
readln(n,m,q);
for i:=1 to m do read(a[i]);
for i:=1 to q do
begin
readln(l,r);
fillchar(b,sizeof(b),true);
for j:=l to r do b[a[j]]:=false;
for j:=1 to n do
if (b[j]=true)and(b[j+1]=true) then
begin
writeln(j,' ',j+1);
break;
end;
if j>=n then writeln('-1',' ','-1');
end;
a:array[0..200000]of longint;
b:array[0..200000]of boolean;
n,m,q,l,r:longint;
i,j,k:longint;
Procedure openn;
begin
assign(input,'stall.in'); assign(output,'stall.out');
reset(input); rewrite(output);
end;
Procedure closee;
begin
close(input); close(output);
end;
begin
readln(n,m,q);
for i:=1 to m do read(a[i]);
for i:=1 to q do
begin
readln(l,r);
fillchar(b,sizeof(b),true);
for j:=l to r do b[a[j]]:=false;
for j:=1 to n do
if (b[j]=true)and(b[j+1]=true) then
begin
writeln(j,' ',j+1);
break;
end;
if j>=n then writeln('-1',' ','-1');
end;
end.
本题没难度,本人的代码没有技术含量,纯暴力解法,可能会超时。。。