func_code_string: #include <bits/stdc++.h>   using namespace std;   inline void input(long long &x) {     long long y = 1;     char c = getchar();     while (c <  0  || c >  9 ) {       if (c ==  - ) y = -1;       c = getchar();     }     x = 0;     while (c >=  0  && c <=  9 ) {       x = x * 10 + (c -  0 );       c = getchar();     }     x = x * y;   }   const long long inf = 1e18;   long long f, t, temp, a1, cnt, p1, a2, now, p2, resf, rest;   long long ans = inf;   signed main() {     input(f);     input(t);     input(temp);     input(a1);     input(cnt);     input(p1);     input(a2);     input(now);     input(p2);     if (cnt > now) {       swap(a1, a2);       swap(p1, p2);       swap(cnt, now);     }     for (register long long i = 0; (i - 1) * a1 <= f; ++i) {       resf = f - min(i * a1, f);       rest = t - min(i * a1, f) * cnt;       if (!resf) {         if (rest < 0) break;         ans = min(ans, i * p1);         break;       }       if (temp * resf > rest && now * resf > rest) continue;       if (temp * resf <= rest)         ans = min(ans, i * p1);       else {         long long x, pk;         if ((rest - temp * resf) % (now - temp) == 0)           x = (rest - temp * resf) / (now - temp) + 0;         else           x = (rest - temp * resf) / (now - temp) + 1;         if (x % a2 == 0)           pk = (x / a2) + 0;         else           pk = (x / a2) + 1;         ans = min(ans, pk * p2 + i * p1);       }     }     ans = max(ans, 0ll);     if (ans < inf)       printf( %lld n , ans);     else       puts( -1 );     return 0;   }   