Created
August 5, 2014 17:18
-
-
Save akahana-1/3baf1972246902eb080b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cmath> | |
#include <algorithm> | |
using namespace std; | |
int main(){ | |
int x, y, s, m; | |
while(cin >> x >> y >> s, x){ | |
m = 0; | |
for(int i = 1;i < s;++i){ | |
for(int j = 1;j < s;++j){ | |
int res = (int)(i * (100 + x) / 100) + (int)(j * (100 + x) / 100); | |
if(res == s){ | |
res = (int)(i * (100 + y) / 100) + (int)(j * (100 + y) / 100); | |
m = max(res, m); | |
} | |
} | |
} | |
cout << m << endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment