The first line contains two integers (, ),The second line contains integers (),Each of the next lines contains two integers (), donating once query.
lines, each line contains one integer donating the answer for each query.
3 2 1 1 2 1 3 2 3
6 3