fork(1) download
  1. #include <stdio.h>
  2. #include <math.h>
  3. int main(void) {
  4. int t, n, m, k;
  5. scanf("%d",&t);
  6. while(t--){
  7. scanf("%d%d",&n,&m);
  8. k = m/(float)n*100+1;
  9. if(k<100) printf("%d\n",(int)ceil((double)(100*m-k*n)/(k-100)));
  10. else printf("-1\n");
  11. }
  12. return 0;
  13. }
Success #stdin #stdout 0s 2252KB
stdin
6
10 8
100 80
47 47
99000 0
1000000000 470000000
1000000000 0
stdout
1
6
-1
1000
19230770
10101011