Skip to content

Instantly share code, notes, and snippets.

@asi1024
Created July 13, 2014 18:00
Show Gist options
  • Save asi1024/58800d51aec469df7538 to your computer and use it in GitHub Desktop.
Save asi1024/58800d51aec469df7538 to your computer and use it in GitHub Desktop.
int f(int a, int b) {
return a * (100+b) / 100;
}
int main() {
int x, y, s;
while (cin >> x >> y >> s, x) {
int res = -1;
REP(i,1024) REP(j,1024) {
if (i == 0 || j == 0) continue;
if (f(i,x) + f(j,x) == s) {
res = max(res, f(i,y) + f(j,y));
}
}
cout << res << endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment