func_code_string: #include <bits/stdc++.h>   using namespace std;   int p, first, cnts, cntw, S, W;   int solve(long long picked) {     int cap1 = p, cap2 = first, cnt1 = cnts, cnt2 = cntw;     long long temp = picked;     cap1 -= (picked * S);     cnt1 -= picked;     if (cap1 >= W) {       temp += min(cap1 / W, cnt2);       cnt2 -= min(cap1 / W, cnt2);     }     if (S <= W) {       temp += min(cap2 / S, cnt1);       cap2 -= (min(cap2 / S, cnt1) * S);       temp += min(cap2 / W, cnt2);     } else {       temp += min(cap2 / W, cnt2);       cap2 -= (min(cap2 / W, cnt2) * W);       temp += min(cap2 / S, cnt1);     }     return temp;   }   int main() {     int t;     scanf( %d , &t);     while (t--) {       scanf( %d %d , &p, &first);       scanf( %d %d , &cnts, &cntw);       scanf( %d %d , &S, &W);       long long ans = 0, temp;       for (int pickedS = 0; pickedS <= min(cnts, p / S); pickedS++) {         temp = solve(pickedS);         ans = max(ans, temp);       }       printf( %lld n , ans);     }     return 0;   }   