func_code_string: #include <bits/stdc++.h>   using namespace std;   vector<pair<int, int> > v;   vector<string> veg;   bool comp(pair<int, int> p1, pair<int, int> p2) {     return (p1.first < p2.first or             ((p1.first == p2.first) and (p1.second < p2.second)));   }   int main() {     int n, m, k, t, x, y;     veg.push_back( Grapes );     veg.push_back( Carrots );     veg.push_back( Kiwis );     cin >> n >> m >> k >> t;     while (k--) {       cin >> x >> y;       v.push_back(make_pair(x, y));     }     sort(v.begin(), v.end(), comp);     while (t--) {       int f = 0, s = 0;       int left = 0, right = v.size() - 1;       cin >> f >> s;       int mid = (left + right) / 2, flag = 0;       while (left < right) {         mid = left + (right - left) / 2 + 1;         if (v[mid].first == f and v[mid].second == s) {           flag = 1;           cout <<  Waste  << endl;           break;         }         if (f < v[mid].first or (f == v[mid].first and s < v[mid].second))           right = mid - 1;         else           left = mid;       }       if (!flag) {         if (v[left].first == f and v[left].second == s)           cout <<  Waste  << endl;         else {           if (v[left].first > f or v[left].first == f and v[left].second > s)             left--;           cout << veg[((f - 1) * m + s - left - 1) % 3] << endl;         }       }     }     return 0;   }   