func_code_string: #include <bits/stdc++.h>   using namespace std;   int y[3], m[3], p[3];   int result;   bool solve(int);   bool if_win(int, int, int);   int main() {     double lb = 0, ub = 0xffffff;     result = 0xfffffff;     scanf( %d%d%d , &y[0], &y[1], &y[2]);     scanf( %d%d%d , &m[0], &m[1], &m[2]);     scanf( %d%d%d , &p[0], &p[1], &p[2]);     if (if_win(0, 0, 0)) {       printf( %d n , 0);       return 0;     }     for (int i = 0; i < 100; i++) {       int mid = (int)((lb + ub) / 2 + 0.5);       if (solve(mid))         ub = mid;       else         lb = mid;       if (lb == ub || ub - lb == 1) break;     }     printf( %d n , result);     return 0;   }   bool solve(int x) {     int i;     int j;     int z;     for (i = x / p[0]; i >= 0; i--) {       for (j = (x - i * p[0]) / p[1]; j >= 0; j--) {         if (y[1] + j < m[2]) break;         for (z = (x - i * p[0] - j * p[1]) / p[2]; z >= 0; z--) {           int prise = p[0] * i + p[1] * j + p[2] * z;           if (if_win(i, j, z)) {             result = min(result, prise);             return true;           }         }       }     }     return false;   }   bool if_win(int i, int j, int z) {     if (y[1] + j <= m[2]) return false;     int time = m[0] / (y[1] + j - m[2]);     if (m[0] % (y[1] + j - m[2]) != 0) time++;     if (y[0] + i - time * (m[1] - y[2] - z) > 0)       return true;     else       return false;   }   