Skip to content

Instantly share code, notes, and snippets.

@akahana-1
Created August 5, 2014 17:18
Show Gist options
  • Save akahana-1/3baf1972246902eb080b to your computer and use it in GitHub Desktop.
Save akahana-1/3baf1972246902eb080b to your computer and use it in GitHub Desktop.
#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