#include using namespace std; typedef long long ll; typedef pair P; #define REP(i,n) for(int i=0;i> N >> T; vector

a(N); REP(i,N){ int x; cin >> x; a[i]=P(x,i+1); } sort(a.begin(),a.end()); vector v(N); REP(i,N){ v[a[i].second]=i+1; } while(T--){ int x,y; cin >> x >> y; if(v[x]