Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Created with IntelliJ IDEA.
- * User: Fcdkbear
- * Date: 11.02.13
- * Time: 16:48
- * To change this template use File | Settings | File Templates.
- */
- import java.util.Scanner;
- public class test {
- public static void main(String [] args)
- {
- Scanner sc=new Scanner(System.in);
- int n=sc.nextInt();
- int T=sc.nextInt();
- int res=-2000000000;
- for (int i = 0; i<n; ++i)
- {
- int f=sc.nextInt();
- int t=sc.nextInt();
- int cur=f;
- if (t>T)
- cur-=(t-T);
- res=Math.max(res,cur);
- }
- System.out.println(res);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement