malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   int gcd(int i, int j) {     if (j == 0)       return i;     else       return gcd(j, i % j);   }   template <typename T>   inline T getint() {     T val = 0;     char c;     bool neg = false;     while ((c = getchar()) && !(c >=  0  && c <=  9 )) {       neg |= c ==  - ;     }     do {       val = (val * 10) + c -  0 ;     } while ((c = getchar()) && (c >=  0  && c <=  9 ));     return val * (neg ? -1 : 1);   }   const long long INF = 1e17;   const int Y = 200100;   vector<int> Ed[Y];   int mx;   int ans[Y];   int n, k;   int qw(int l, int r) {     vector<int> q;     for (int j = l; j <= r; ++j) {       for (auto x : Ed[j]) q.push_back(x);     }     sort(q.begin(), q.end());     cout <<  ?   << q.size() <<    ;     for (auto x : q) cout << x <<    ;     cout << endl;     int x;     cin >> x;     return x;   }   void Mrec(int l, int r) {     if (l > r) return;     if (r == l) {       set<int> q;       for (int j = 0; j < n; ++j) {         q.insert(j + 1);       }       for (auto x : Ed[l]) {         q.erase(q.find(x));       }       cout <<  ?   << q.size() <<    ;       for (auto x : q) cout << x <<    ;       cout << endl;       cin >> ans[l];       return;     }     int len = (r - l + 1) / 2;     int mid = l + len - 1;     int r1 = qw(l, mid);     if (r1 == mx) {       for (int j = mid + 1; j <= r; ++j) ans[j] = mx;       if (len == 1 || l == r) {         set<int> q;         for (int j = 0; j < n; ++j) {           q.insert(j + 1);         }         for (auto x : Ed[l]) {           q.erase(q.find(x));         }         cout <<  ?   << q.size() <<    ;         for (auto x : q) cout << x <<    ;         cout << endl;         cin >> ans[l];         return;       } else {         Mrec(l, mid);       }     } else {       for (int j = l; j <= mid; ++j) ans[j] = mx;       ++mid;       if (r == mid || l == r) {         set<int> q;         for (int j = 0; j < n; ++j) {           q.insert(j + 1);         }         for (auto x : Ed[r]) {           q.erase(q.find(x));         }         cout <<  ?   << q.size() <<    ;         for (auto x : q) cout << x <<    ;         cout << endl;         cin >> ans[r];         return;       } else {         Mrec(mid, r);       }     }   }   int32_t main() {     cin.tie(0);     cout.tie(0);     ios_base::sync_with_stdio(false);     int t;     cin >> t;     while (t--) {       cin >> n >> k;       for (int i = 0; i < k; ++i) ans[i] = 0;       for (int i = 0; i < k; ++i) {         Ed[i].clear();         int tt;         cin >> tt;         for (int j = 0; j < tt; ++j) {           int tmp;           cin >> tmp;           Ed[i].push_back(tmp);         }       }       cout <<  ?   << n;       for (int i = 1; i <= n; ++i) cout <<     << i;       cout << endl;       cin >> mx;       Mrec(0, k - 1);       cout <<  !  ;       for (int i = 0; i < k; ++i) cout << ans[i] <<    ;       cout << endl;       string s;       cin >> s;       if (s ==  Incorrect ) {         return 0;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   signed main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     int n;     cin >> n;     vector<int> data(n), ans(n);     long long suma = 0;     for (auto &i : data) cin >> i;     for (int i = 0; i < n; ++i) {       vector<int> data1;       data1 = data;       for (int j = i - 1; j >= 0; --j) data1[j] = min(data1[j], data1[j + 1]);       for (int j = i + 1; j < n; ++j) data1[j] = min(data1[j], data1[j - 1]);       long long sum = 0;       for (auto i : data1) sum += i;       if (sum > suma) {         suma = sum;         ans = data1;       }     }     for (auto i : ans) cout << i <<    ;     return 0;   }
#include<bits/stdc++.h>   using namespace std;   #define sz(x) (int)(x).size()    #define int long long int   #define loop(i,a,b) for(int i=a;i<b;i++)   #define scan(arr,n) for (int i = 0; i < n; ++i) cin >> arr[i]   #define vi vector<int>   #define si set<int>   #define pii pair <int, int>   #define sii set<pii>   #define vii vector<pii>   #define mii map <int, int>   #define pb push_back   #define ff first   #define ss second   #define all(aa) aa.begin(), aa.end()   #define rall(a) a.rbegin() , a.rend()   #define read(a,b) int a,b;  cin>>a>>b   #define readt(a,b,c) int a,b,c; cin>>a>>b>>c   #define readf(a,b,c,d) int a,b,c,d; cin>>a>>b>>c>>d;   #define print(v) for(auto x:v) cout<<x<<   ;cout<<endl   #define printPair(res) for(pair<int,int>& p:res) cout<<p.first<<   <<p.second<<endl;   #define faster ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)         void solve(int test)   {      int n;cin>>n;     // if(n<=9)     // {     //   cout<<n<<endl;     //   return ;     // }     // if(n<=100)     // {     //  int ans=9;     //  loop(i,10,100)     //  {     //   if(i%10==i/10)     //     ans++;     //  }        //  cout<<ans<<endl;     //  return ;     // }        int cp=n , d=0;     while(cp!=0)     {       d++;       cp/=10;     }        int ans=9*(d-1);     int f=n/pow(10,d-1);     ans+=f;     int cpp=f;     string req;     loop(i,0,d)     req+=to_string(f);        f=stoi(req);     // for(int i=1;i<=d-1;i++)     // {     //   int prev=f;     //   f=f*pow(10,i) ;     //   f+=prev;     // }        //cout<<f<<endl;        if(f>n)     {       ans--;     }        cout<<ans<<endl;   }      int32_t main()   {         #ifndef ONLINE_JUDGE             freopen( input.txt ,  r , stdin);             freopen( op.txt ,  w , stdout);         #endif         faster;         //fact(mod);         int t=1;         cin>>t;         for(int test=1;test<=t;test++)         {           //cout<< Case # <<test<< :  ;             solve(test);         }   }
#include <bits/stdc++.h>   using namespace std;   string st;   vector<long> v;   long r;   int main() {     ios_base::sync_with_stdio(0);     cin >> st;     st +=  + ;     for (int i = 0; i < st.size(); i++) {       if (st[i] ==  + ) {         v.push_back(r);         r = 0;       } else         r = r * 10 + st[i] - 48;     }     sort(v.begin(), v.end());     for (int i = 0; i < v.size(); i++) {       if (i) cout <<  + ;       cout << v[i];     }     cout << endl;     cin.get();     cin.get();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }   const int MAXN = 2500;   struct P {     int x, y;     P() {}     P(int x, int y) : x(x), y(y) {}   };   long long operator^(const P& a, const P& b) {     return (long long)a.x * b.y - (long long)a.y * b.x;   }   P operator-(const P& a, const P& b) { return P(a.x - b.x, a.y - b.y); }   bool operator<(const P& a, const P& b) {     bool apos = a.y > 0 || a.y == 0 && a.x > 0;     bool bpos = b.y > 0 || b.y == 0 && b.x > 0;     if (apos != bpos) return apos;     return (a ^ b) > 0;   }   int n;   P p[MAXN];   long long C[MAXN + 1][5 + 1];   P q[2 * (MAXN - 1)];   int nq;   long long solve() {     for (int i = (0); i <= (n); ++i)       for (int j = (0); j <= (5); ++j) C[i][j] = 0;     for (int i = (0); i <= (n); ++i) {       C[i][0] = 1;       for (int j = (1); j <= (min(5, i)); ++j)         C[i][j] = C[i - 1][j - 1] + C[i - 1][j];     }     long long cnttot = C[n][5];     long long cntside = 0;     for (int i = (0); i < (n); ++i) {       nq = 0;       for (int j = (0); j < (n); ++j)         if (j != i) q[nq++] = p[j] - p[i];       sort(q, q + nq);       for (int j = (0); j < (nq); ++j) q[nq + j] = q[j];       int to = 0;       for (int at = (0); at < (nq); ++at) {         to = max(to, at + 1);         while (to - at < nq && (q[at] ^ q[to]) > 0) ++to;         int cur = to - at - 1;         cntside += C[cur][3];       }     }     return 5 * cnttot - cntside;   }   void run() {     scanf( %d , &n);     for (int i = (0); i < (n); ++i) scanf( %d%d , &p[i].x, &p[i].y);     printf( %lld n , solve());   }   int main() {     run();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   double p[22], f[(1 << 20) + 10], ans[22];   int n, m;   int main() {     int cnt = 0;     scanf( %d%d , &n, &m);     for (int i = 1; i <= n; i++) {       scanf( %lf , &p[i]);       if (p[i] > 1e-7) cnt++;     }     if (cnt <= m) {       for (int i = 1; i <= n; i++)         if (p[i] > 1e-7)           printf( 1  );         else           printf( 0  );       return 0;     }     int ss = (1 << n) - 1;     f[0] = 1;     for (int i = 0; i <= ss; i++) {       cnt = 0;       for (int j = 1; j <= n; j++)         if (i & (1 << (j - 1))) cnt++;       if (cnt > m) continue;       if (cnt == m) {         for (int j = 1; j <= n; j++)           if (i & (1 << (j - 1))) ans[j] += f[i];         continue;       }       double t = 1;       for (int j = 1; j <= n; j++)         if (i & (1 << (j - 1))) t -= p[j];       for (int j = 1; j <= n; j++) {         if (i & (1 << (j - 1))) continue;         f[i + (1 << (j - 1))] += f[i] * p[j] / t;       }     }     for (int i = 1; i <= n; i++) printf( %.7lf  , ans[i]);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, a[100002];   int b[100002];   int main() {     scanf( %d , &n);     for (int i = 0; i < n; i++) scanf( %d , a + i);     int ret = 0;     for (int i = n - 1; i >= 0; i--) {       int mx = 1;       for (int j = 1; j * j <= a[i]; j++)         if (a[i] % j == 0) {           mx = max(mx, 1 + b[a[i] / j]);           mx = max(mx, 1 + b[j]);         }       for (int j = 1; j * j <= a[i]; j++)         if (a[i] % j == 0) {           if (j != 1) b[j] = max(b[j], mx);           b[a[i] / j] = max(b[a[i] / j], mx);         }       ret = max(ret, mx);     }     cout << ret << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void solve() {     int n;     cin >> n;     int count[2] = {0, 0};     bool all_even = 1;     for (int i = 0; i < n; i++) {       static string s;       cin >> s;       if (static_cast<int>(s.size()) & 1) all_even = 0;       for (const char &c : s) count[c -  0 ]++;     }     if (all_even && (count[0] & 1) && (count[1] & 1))       cout << n - 1;     else       cout << n;     cout <<   n ;   }   int main() {     ios_base::sync_with_stdio(0), cin.tie(0);     int t = 1;     cin >> t;     while (t--) solve();     return 0;   }
#include<bits/stdc++.h>   using namespace std;   typedef long long ll;   typedef pair<int,int> PII;   const int maxn=1111111,mod=998244353;   #define MP make_pair   #define PB push_back   #define lson o<<1,l,mid   #define rson o<<1|1,mid+1,r   #define FOR(i,a,b) for(int i=(a);i<=(b);i++)   #define ROF(i,a,b) for(int i=(a);i>=(b);i--)   #define MEM(x,v) memset(x,v,sizeof(x))   inline ll read(){    char ch=getchar();ll x=0,f=0;    while(ch< 0  || ch> 9 ) f|=ch== - ,ch=getchar();    while(ch>= 0  && ch<= 9 ) x=x*10+ch- 0 ,ch=getchar();    return f?-x:x;   }   int n,m,deg[maxn],p[maxn],q[maxn],rem,que[maxn],h,r,el,head[maxn],to[maxn],nxt[maxn];   bool in[maxn];   set<PII,greater<PII> > s;   set<int> nvis,e[maxn];   inline void add(int u,int v){    e[u].insert(v);   }   inline void add2(int u,int v){   // printf( add(%d,%d) n ,u,v);    to[++el]=v;nxt[el]=head[u];head[u]=el;   }   void clear(){    FOR(i,1,n) deg[i]=p[i]=q[i]=head[i]=in[i]=0;    s.clear();    nvis.clear();    FOR(i,1,n) e[i].clear();    FOR(i,1,el) to[i]=nxt[i]=0;    el=0;   }   bool dfs(int u,int f){    int son=0,cnt=0;    for(int i=head[u];i;i=nxt[i]){     int v=to[i];     if(dfs(v,u)) cnt++;     else son=v;    }   // printf( u=%d,cnt=%d n ,u,cnt);    if(cnt){     for(int i=head[u];i;i=nxt[i]){      int v=to[i];      if(!in[v]) continue;      p[v]=rem;      q[v]=--rem;     }     q[u]=rem+cnt;     p[u]=rem--;     return in[u]=false;    }    else if(!f){     assert(son);   //  puts( in );     p[u]=q[u]=rem--;     swap(p[u],p[son]);     return in[u]=false;    }    else return in[u]=true;   }   void bfs(int s){    que[h=r=1]=s;    while(h<=r){     int u=que[h++];     for(set<int>::iterator it=nvis.begin();it!=nvis.end();){      int v=*it;   //   printf( try %d to %d n ,u,v);      if(e[u].find(v)!=e[u].end()){it++;continue;}      set<int>::iterator it1=it++;      nvis.erase(it1);      que[++r]=v;      add2(u,v);     }    }    dfs(s,0);   /* set<int>::iterator it=nvis.begin();    int son=0;    if(!vec[u].empty()){     p[u]=rem;     FOR(i,0,(int)vec[u].size()-1) p[vec[u][i]]=rem-i-1;     FOR(i,0,(int)vec[u].size()-1) q[vec[u][i]]=rem-i;     q[u]=rem-=vec[u].size();     return false;    }    else if(rt){     assert(son);     p[u]=q[u]=rem--;     swap(q[u],q[son]);     return false;    }    else return true;*/   }   void solve(){    n=read();m=read();    FOR(i,1,m){     int u=read(),v=read();     add(u,v);add(v,u);     deg[u]++;deg[v]++;    }    FOR(i,1,n) s.insert(MP(deg[i],i));    rem=n;    while(!s.empty() && s.begin()->first==(int)s.size()-1){     int u=s.begin()->second;     s.erase(s.begin());   //  printf( erase %d n ,u);     p[u]=q[u]=rem--;     for(set<int>::iterator it=e[u].begin();it!=e[u].end();it++){      int v=*it;      s.erase(MP(deg[v],v));      s.insert(MP(--deg[v],v));      e[v].erase(u);     }     e[u].clear();     deg[u]=0;    }    FOR(i,1,n) if(!p[i]) nvis.insert(i);    FOR(i,1,n) if(!p[i]){     nvis.erase(i);     bfs(i);    }    FOR(i,1,n) printf( %d  ,p[i]);    puts(  );    FOR(i,1,n) printf( %d  ,q[i]);    puts(  );    clear();   }   int main(){    int T=read();    while(T--) solve();   }
#include <bits/stdc++.h>   using namespace std;   long long n, x, k, lb, ub, ans = -1;   void init() {     long long l, r;     scanf( %lld%lld%lld%lld , &n, &l, &r, &k);     x = (r >= l ? r - l + 1 : r + n - l + 1) % n;   }   void solve() {     for (long long i = k, j, r; i; i = j) {       j = k / (k / i + 1);       r = k / i;       ub = min(2 * n, i);       lb = max(n, j + 1);       ub = min(ub, min((2 * n + k - 2 * x + 1) / (r + 1), (k - x) / r));       lb = max(lb, (k - 2 * x + r - 1) / r);       if (ub >= lb) ans = max(ans, ub);     }     if (x <= k && k <= x * 2) ans = max(ans, n + min(k - x, x - 1) + n - x + 1);     if (!x && k == n) ans = max(ans, n + 1);     printf( %lld n , ~ans ? ans - n : ans);   }   int main() {     init();     solve();   }
#include <bits/stdc++.h>   using namespace std;   const int N = 1e9;   const int M = 1e9;   int ix, iy, fx, fy;   map<pair<int, int>, int> pres;   map<pair<int, int>, int> dist;   map<pair<int, int>, bool> vis;   int dx[] = {-1, -1, -1, 0, 0, 0, 1, 1, 1};   int dy[] = {-1, 0, 1, -1, 0, 1, -1, 0, 1};   bool check(int x, int y) {     if (x >= 1 && x <= 1e9 && y >= 1 && y <= 1e9) {       if (pres[make_pair(x, y)]) return true;       return false;     }     return false;   }   void bfs(int x, int y) {     queue<pair<int, int> > q;     pair<int, int> tmp;     q.push(make_pair(x, y));     while (q.size() > 0) {       tmp = q.front();       q.pop();       for (int i = 0; i < 9; ++i) {         int x1 = tmp.first + dx[i];         int y1 = tmp.second + dy[i];         if (check(x1, y1) && vis[make_pair(x1, y1)] == 0) {           vis[make_pair(x1, y1)] = 1;           dist[make_pair(x1, y1)] = dist[tmp] + 1;           q.push(make_pair(x1, y1));         }       }     }   }   int main() {     cin >> ix >> iy >> fx >> fy;     int Q;     cin >> Q;     int x, y, z;     for (int q = 1; q <= Q; ++q) {       scanf( %d%d%d , &x, &y, &z);       for (int i = y; i <= z; ++i) {         pres[make_pair(x, i)] = 1;       }     }     dist[make_pair(ix, iy)] = 0;     dist[make_pair(fx, fy)] = 1e9;     vis[make_pair(ix, iy)] = 1;     bfs(ix, iy);     int res = dist[make_pair(fx, fy)];     if (res >= 1e9) res = -1;     cout << res << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     std::ios::sync_with_stdio(false);     double n, m;     char ch;     cin >> n >> ch >> m;     if (n >= 12) n -= 12;     double ans1, ans2;     ans2 = 6 * m;     ans1 = n * 30 + 0.5 * m;     cout << ans1 <<     << ans2 << endl;   }
#include <bits/stdc++.h>   using namespace std;   long long getInt() {     long long ret;     char tmpc;     bool sign = 0;     while (tmpc = getchar(), !isdigit(tmpc)) sign = (tmpc ==  - );     ret = tmpc -  0 ;     while (tmpc = getchar(), isdigit(tmpc)) ret = ret * 10 + tmpc -  0 ;     if (sign) ret *= -1;     return ret;   }   const int mx = 1e5 + 10;   int n, ans, dp[2][mx];   int main() {     n = getInt();     vector<int> in(n + 2);     for (int i = 1; i <= n; i++) {       in[i] = getInt();       dp[0][i] = min(in[i], dp[0][i - 1] + 1);     }     for (int i = n; i >= 1; i--) {       dp[1][i] = min(in[i], dp[1][i + 1] + 1);       ans = max(ans, min(dp[0][i], dp[1][i]));     }     printf( %d n , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long int n, f, a, b;     vector<pair<long long int, long long int> > v;     cin >> n >> f;     int i;     for (i = 0; i < n; i++) {       cin >> a >> b;       v.push_back(make_pair(a, b));     }     long long int ans = 0;     vector<long long int> t;     for (i = 0; i < n; i++) {       ans = ans + min(v[i].first, v[i].second);       long long int mins =           min(v[i].first * 2, v[i].second) - min(v[i].first, v[i].second);       t.push_back(mins);     }     sort(t.begin(), t.end());     for (i = n - 1; i >= 0; i--) {       if (t[i] > 0 && f != 0) {         ans = ans + t[i];         f--;       }       if (f == 0) break;     }     cout << ans;   }
#include <bits/stdc++.h>   using ll = long long;   int n, a, v[10005];   ll d[1000005], ans;   char s[10005];   int main() {     scanf( %d , &a);     scanf( %s , s + 1);     n = std::strlen(s + 1);     int lim = n * 10;     for (int i = 1; i <= n; ++i) v[i] = v[i - 1] + s[i] -  0 ;     for (int l = 1; l <= n; ++l)       for (int r = l; r <= n; ++r) {         d[v[r] - v[l - 1]]++;       }     if (a == 0) {       ans = d[0] * (ll)n * (n + 1) - d[0] * d[0];     } else {       for (int i = 1; i * i <= a; ++i) {         if (a % i) continue;         int j = a / i;         if (i <= lim && j <= lim) ans += d[i] * d[j] * (1 + (i != j));       }     }     printf( %lld , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 1e5 + 5;   const long long int MOD = 1e9 + 7;   const long long int INV2 = 500000004;   int A[N][4];   int main(int argc, char const *argv[]) {     cin.sync_with_stdio(0);     cin.tie(0);     int n, m;     cin >> n >> m;     int v = 1;     for (int i = 1; i <= n; i++) {       A[i][0] = v++;       A[i][3] = v++;     }     for (int i = 1; i <= n; i++) {       A[i][1] = v++;       A[i][2] = v++;     }     for (int i = 1; i <= n; i++) {       if (A[i][1] <= m) cout << A[i][1] <<    ;       if (A[i][0] <= m) cout << A[i][0] <<    ;       if (A[i][2] <= m) cout << A[i][2] <<    ;       if (A[i][3] <= m) cout << A[i][3] <<    ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   vector<string> split(const string& s, const string& delim =    ) {     vector<string> res;     string t;     for (int i = 0; i != s.size(); i++) {       if (delim.find(s[i]) != string::npos) {         if (!t.empty()) {           res.push_back(t);           t =   ;         }       } else {         t += s[i];       }     }     if (!t.empty()) {       res.push_back(t);     }     return res;   }   vector<int> splitInt(const string& s, const string& delim =    ) {     vector<string> tok = split(s, delim);     vector<int> res;     for (int i = 0; i != tok.size(); i++) res.push_back(atoi(tok[i].c_str()));     return res;   }   template <typename T>   void print(T a) {     cerr << a;   }   static void print(long long a) { cerr << a <<  L ; }   static void print(string a) { cerr <<     << a <<    ; }   template <typename T>   void print(vector<T> a) {     cerr <<  { ;     for (int i = 0; i != a.size(); i++) {       if (i != 0) cerr <<  ,  ;       print(a[i]);     }     cerr <<  }  << endl;   }   int main() {     int n, m;     while (cin >> n >> m) {       int res = 0;       if (n <= 1 || m <= 1) res = m * n;       if (n == 2 || m == 2) {         int x = max(m, n);         res = max(res, x / 4 * 4 + min((x % 4) * 2, 4));       }       int x = m * n / 2;       int y = m * n - x;       res = max(max(res, x), y);       res = min(res, m * n);       cout << res << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long double s, a, b, c;   int main() {     cin >> s >> a >> b >> c;     if (a + b + c == 0) {       cout << 0 <<     << 0 <<     << 0 << endl;       return 0;     }     long double x = s * a / (a + b + c);     long double y = s * b / (a + b + c);     long double z = s * c / (a + b + c);     printf( %.10lf %.10lf %.10lf n , (double)x, (double)y, (double)z);     return 0;   }
#include <bits/stdc++.h>      using namespace std;      typedef unsigned long long ll;   typedef long double ld;   typedef vector<ll> vl;   typedef vector<int> vi;   typedef vector<vector<int>> vvi;   typedef vector<vector<ll>> vvl;   typedef vector<ll, vector<ll>> vll;   #define ln   n    #define mp make_pair   #define pb push_back   #define st first   #define nd second   #define all(x) (x).begin(), (x).end()   #define sz(x) ((ll)(x).size())      void solve()   {     ll n;     cin >> n;        if (n % 2 != 0)     {       cout <<  NO  << ln;       return;     }        ll j = n;        while (j % 2 == 0)     {       j = j / 2;     }        if (j == 1)     {       cout <<  YES  << ln;       return;     }        ll sq = sqrt(j);     if (sq * sq == j)     {       cout <<  YES  << ln;       return;     }        cout <<  NO  << ln;   }      int main()   {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);        int test;     cin >> test;     for (int i = 1; i <= test; i++)       solve();        return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 100010;   int v[maxn], b[maxn];   int n, k;   long long base, sum;   int cmp(const int &i, const int &j) { return i > j; }   int main() {     while (scanf( %d %d , &n, &k) != EOF) {       scanf( %I64d , &base);       sum = 0;       for (int i = 0; i < n; i++) {         scanf( %d , &v[i]);         if (i != n - 1) b[i] = v[i];       }       sort(b, b + n - 1, cmp);       int ans = n;       for (int i = 0; i < k; i++) sum += b[i];       for (int i = 0; i < n; i++) {         int s = lower_bound(b, b + n - 1, v[i], cmp) - b;         long long now = sum;         if (s >= k) {           now += v[i];           now -= b[k - 1];         }         if (now > base) {           ans = i + 1;           break;         }       }       printf( %d n , ans);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int gcd(int x, int y) {     int i, z;     while (y != 0) {       z = x % y;       x = y;       y = z;     }     return x;   }   int a[110];   int b[110];   int main() {     int n, m, i, j, k, count = 0, s = 0;     scanf( %d%d , &n, &m);     for (i = 0; i <= n; i++) scanf( %d , &a[i]);     for (i = 0; i <= m; i++) scanf( %d , &b[i]);     for (i = 0; i < n; i++) {       if (a[i] != 0) {         n = n - i;         break;       }     }     for (j = 0; j < m; j++) {       if (b[j] != 0) {         m = m - j;         break;       }     }     if (a[i] < 0 && n != 0) count++;     if (b[j] < 0 && m != 0) count++;     for (k = i; k <= n; k++) {       if (a[k] < 0 && k != n) a[k] = fabs(a[k]);       if (a[k] < 0 && k == n) {         a[k] = fabs(a[k]);         s++;       }     }     for (k = j; k <= m; k++) {       if (b[k] < 0 && k != m) b[k] = fabs(b[k]);       if (b[k] < 0 && k == m) {         b[k] = fabs(b[k]);         s++;       }     }     if (m > n) {       printf( 0/1 n );       return 0;     }     if (count % 2 == 1) printf( - );     if (n > m)       printf( Infinity n );     else if (n == m && n != 0 && b[j] % a[i] == 0)       printf( 1/%d n , b[j] / a[i]);     else if (n == m && n != 0)       printf( %d/%d n , a[i] / gcd(a[i], b[j]), b[j] / gcd(a[i], b[j]));     else if (n == 0 && m == 0 && s % 2 == 0)       printf( %d/%d n , a[n] / gcd(a[n], b[m]), b[m] / gcd(a[n], b[m]));     else if (n == 0 && m == 0 && s % 2 == 1)       printf( -%d/%d n , a[n] / gcd(a[n], b[m]), b[m] / gcd(a[n], b[m]));     return 0;   }