#include<iostream> #include<cstdio> #include<algorithm> using namespace std;
int dp[10001][10001]; struct hehe{
int v,w; long long e; }a[10001];
bool cmp(hehe l,hehe r){ return l.e>r.e; } int n,q;
int find(long long num){ int l=1; int r=n; int mid; int ans=0; while(l<=r){ mid=(l+r)/2; if(a[mid].e>num){ ans=mid; l=mid+1; } else{ r=mid-1; } } return ans; }