#include #define N 200005 #define mod 1000000007 #define gc getchar() using namespace std; int read(){ int x=0; char ch; while((ch=gc)<48); while(ch>=48) x=x*10+ch-48,ch=gc; return x; } int power(int x,int y){ int res=1; while(y){ if(y&1) res=1ll*res*x%mod; x=1ll*x*x%mod; y=y/2; } return res; } int n,V,m; struct node{ int c,d; }p[N]; bool cmp(node p1,node p2){ if(p1.c==p2.c) return p1.d