we are provided with n different range(l,r) and each range have value (val) associated with it . now we have given k query , in each ↵
query we have given one integer X , and we have to tell the minimum value we can obtain form the ranges in which X <br>lies i.e↵
L<=x<=R , if their does not exist any range print -1 .<br>↵
Input :<br>↵
n — number of range .<br>↵
next n line contain — ( l , r , val ) <br>↵
q — number of query.<br>↵
next q line contain — (X)<br>↵
output :<br>↵
q — line with minimum value.<br>↵
↵
For Example:↵
4============↵
Input:↵
======↵
4<br>↵
0 0 2<br>↵
0 2 10<br>↵
5 6 13<br>↵
1 1 2↵
6↵
0↵
1↵
2↵
3↵
5↵
8↵
↵
Output:↵
2↵
2↵
10↵
-1↵
13↵
-1<br>↵
6<br>↵
0<br>↵
1<br>↵
2<br>↵
3<br>↵
5<br>↵
8<br>↵
↵
Output:↵
=======↵
2<br>↵
2<br>↵
10<br>↵
-1<br>↵
13<br>↵
-1<br>↵
L<=x<=R , if their does not exist any range print -1 .<br>↵
Input :<br>↵
n — number of range .<br>↵
next n line contain — ( l , r , val ) <br>↵
q — number of query.<br>↵
next q line contain — (X)<br>↵
output :<br>↵
q — line with minimum value.<br>↵
↵
For Example:↵
Input:↵
======↵
4<br>↵
0 0 2<br>↵
0 2 10<br>↵
5 6 13<br>↵
1 1 2
6↵
0↵
1↵
2↵
3↵
5↵
8↵
↵
Output:↵
2↵
2↵
10↵
-1↵
13↵
-1
6<br>↵
0<br>↵
1<br>↵
2<br>↵
3<br>↵
5<br>↵
8<br>↵
↵
Output:↵
=======↵
2<br>↵
2<br>↵
10<br>↵
-1<br>↵
13<br>↵
-1<br>↵