fork download
  1. import java.util.*;
  2. public class Main {
  3. public static void main(String[] args) {
  4. final Scanner sc = new Scanner(System.in);
  5. while(sc.hasNext()) {
  6. final int x = sc.nextInt();
  7. final int y = sc.nextInt();
  8. final int s = sc.nextInt();
  9. if(x == 0 && y == 0 && s == 0)
  10. return;
  11. int max = 0;
  12. for(int i = 1; i < s; i++)
  13. for(int j = 1; j < s; j++) {
  14. final int v = i * (100 + x) / 100 + j * (100 + x) / 100;
  15. if(v == s)
  16. max = Math.max(max, i * (100 + y) / 100 + j * (100 + y) / 100);
  17. }
  18. System.out.println(max);
  19. }
  20. }
  21. }
  22.  
Success #stdin #stdout 0.24s 380736KB
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