fork download
  1. from __future__ import division
  2. import math
  3.  
  4. def findX(N,M,Z):
  5. X = math.ceil((N*Z+N-100*M)/(99-Z))
  6. if X <= 0:
  7. return -1
  8. else:
  9. return int(X)
  10.  
  11. for i in range(input()):
  12. s=raw_input().split()
  13. N=float(s[0])
  14. M=float(s[1])
  15. Z = int(M/N * 100)
  16. print findX(N,M,Z)
Success #stdin #stdout 0.01s 8976KB
stdin
7
10 8
100 80
47 47
99000 0
1000000000 470000000
1000 689
10000000000000 47000000000
stdout
1
6
-1
1000
19230770
4
53535353536