#include using namespace std; const int N = 1e5+5,mod=1e9+7; inline int read(){ int x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){ if(ch=='-')f=-1; ch=getchar(); } while(ch>='0'&&ch<='9')x=(x<<3)+(x<<1)+(ch^48),ch=getchar(); return x*f; } int T,n,m,v,cnt; inline int ksm(int a,int b){ int ans=1; while(b){ if(b&1)ans=1ll*ans*a%mod; a=1ll*a*a%mod; b>>=1; }return ans; } struct node{ int p,v; inline bool operator<(node b){ return p