fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5.  
  6. class f
  7. {
  8. public static void main (String[] args) throws java.lang.Exception
  9. {
  10. // your code goes here
  11. Scanner sc=new Scanner(System.in);
  12.  
  13. int n,s;
  14. n=sc.nextInt();
  15. s=sc.nextInt();
  16. int maxx=-1;
  17. for(int i=0;i<n;i++)
  18. {
  19. int d,c;
  20. d=sc.nextInt();
  21. c=sc.nextInt();
  22. if(100*d+c<=s*100 && (-100*d-c+s*100)%100>maxx)
  23. maxx=(-100*d-c+s*100)%100;
  24. }
  25. System.out.println(maxx);
  26. }
  27. }
Success #stdin #stdout 0.11s 380672KB
stdin
5 5
10 10
20 20
30 30
40 40
50 50
stdout
-1