boolcmp(PII a, PII b){return a.first < b.first;}voidsolve(){int n, k;
cin >> n >> k;
vector<PII> v;for(int i =1; i <= n; i++){
PII t;
cin >> t.first >> t.second;
v.push_back(t);}sort(v.begin(), v.end(), cmp);int l =0;for(int i =0; i < n;i++){if(i!=0)
l +=(v[i].first - v[i -1].first)* k;else
l = v[i].first * k;if(l>=v[i].second){//cout << "l1:" << l << endl;
l -= v[i].second;//cout << "l2:" << l << endl;}else{
cout <<"No"<< endl;return;}}
cout <<"Yes"<< endl;}
G
int n, ans;
unordered_map<int, vector<int>> mp;voidinit(){
mp.clear();
ans =0;}voidsolve(){init();
cin >> n;for(int i =1; i <= n; i++){int t;
cin >> t;
mp[i - t].push_back(t);}for(auto&p : mp){auto&vec = p.second;sort(vec.begin(), vec.end(),greater<int>());for(auto i =0; i < vec.size()-1; i +=2){int t = vec[i]+ vec[i +1];if(t >0)
ans += t;elsebreak;}}
cout << ans << endl;}// 1 2 3 4 5 6 7 8 9// 3 -5 5 6 7 -1 9 1 2// 2 -7 2 2 2 -7 2 -7 -7
I
int a, b;int x[7]={0,1,0,0,4,0,0};int y[7]={0,0,2,3,0,5,6};voidsolve(){
cin >> a >> b;for(int i =1; i <=6; i++){for(int j =1; j <=6; j++){for(int k =1; k <=6; k++){if(x[i]+ x[j]+ x[k]== a && y[i]+ y[j]+ y[k]== b){
cout <<"Yes"<< endl;return;}}}}
cout <<"No"<< endl;}