Advertisement
Guest User

Untitled

a guest
Feb 24th, 2013
3,039
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.14 KB | None | 0 0
  1. #include <vector>
  2. #include <list>
  3. #include <map>
  4. #include <set>
  5. #include <deque>
  6. #include <stack>
  7. #include <queue>
  8. #include <algorithm>
  9. #include <sstream>
  10. #include <iostream>
  11. #include <iomanip>
  12. #include <cstdio>
  13. #include <cmath>
  14. #include <cstdlib>
  15. #include <memory.h>
  16. #include <ctime>
  17.  
  18. using namespace std;
  19.  
  20. #define ABS(a) ((a>0)?a:-(a))
  21. #define MIN(a,b) ((a<b)?(a):(b))
  22. #define MAX(a,b) ((a<b)?(b):(a))
  23. #define FOR(i,a,n) for (int i=(a);i<(n);++i)
  24. #define FI(i,n) for (int i=0; i<(n); ++i)
  25. #define pnt pair <int, int>
  26. #define mp make_pair
  27. #define PI 3.14159265358979
  28. #define MEMS(a,b) memset(a,b,sizeof(a))
  29. #define LL long long
  30. #define U unsigned
  31.  
  32.  
  33. int main()
  34. {
  35. #ifdef Fcdkbear
  36.     freopen("in.txt","r",stdin);
  37.     //freopen("out.txt","w",stdout);
  38.     double beg=clock();
  39. #endif
  40.    
  41.     int res=-2000000000;
  42.     int n,T;
  43.     scanf("%d%d",&n,&T);
  44.     FOR(i,0,n)
  45.     {
  46.         int f,t;
  47.         scanf("%d%d",&f,&t);
  48.         int cur=f;
  49.         if (t>T)
  50.             cur-=(t-T);
  51.         res=MAX(res,cur);
  52.     }
  53.     cout<<res<<endl;
  54. #ifdef Fcdkbear
  55.     double end=clock();
  56.     fprintf(stderr,"*** Total time = %.3lf ***\n",(end-beg)/CLOCKS_PER_SEC);
  57. #endif
  58.     return 0;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement