fork download
  1. #include <cstdio>
  2. #include <iostream>
  3. #include <complex>
  4. #include <vector>
  5. #include <utility>
  6. #include <algorithm>
  7. #include <cassert>
  8. #include <queue>
  9. #include <cstdio>
  10. #include <cstdlib>
  11. #include <cstring>
  12. #include <map>
  13. using namespace std;
  14.  
  15. #define rep(i, n) for (int i = 0; i < (int)(n); i++)
  16.  
  17. int main() {
  18. for (;;) {
  19. int X, Y, S;
  20. scanf("%d%d%d", &X, &Y, &S);
  21. if (X == 0 && Y == 0 && S == 0) return 0;
  22.  
  23. int ans = 0;
  24. for (int s1 = 1; s1 <= S; ++s1) {
  25. for (int s2 = 1; s2 <= S; ++s2) {
  26. int x1 = s1 * (100 + X) / 100;
  27. int x2 = s2 * (100 + X) / 100;
  28. if (x1 + x2 == S) {
  29. int y1 = s1 * (100 + Y) / 100;
  30. int y2 = s2 * (100 + Y) / 100;
  31. ans = max(ans, y1 + y2);
  32. }
  33. }
  34. }
  35. printf("%d\n", ans);
  36. }
  37. }
  38.  
Success #stdin #stdout 0.01s 3300KB
stdin
5 8 105
8 5 105
1 2 24
99 98 24
12 13 26
1 22 23
1 13 201
13 16 112
2 24 50
1 82 61
1 84 125
1 99 999
99 1 999
98 99 999
1 99 11
99 1 12
0 0 0
stdout
109
103
24
24
26
27
225
116
62
111
230
1972
508
1004
20
7