Advertisement
Saleh127

CF 1262A

Oct 14th, 2020
59
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ///CF 1262A
  2. #include <bits/stdc++.h>
  3. using namespace std;
  4. #define ll long long
  5. #define test int t; cin>>t; for(int cs=1;cs<=t;cs++)
  6. int main()
  7. {
  8. ios_base::sync_with_stdio(0);
  9. cin.tie(0);cout.tie(0);
  10. test
  11. {
  12. int a,c,d,e=0,f=1e11,i,j;
  13. cin>>a;
  14. while(a--)
  15. {
  16. cin>>c>>d;
  17. e=max(e,c);
  18. f=min(f,d);
  19. }
  20. cout<<max(0,(e-f))<<endl;
  21. }
  22.  
  23.  
  24.  
  25. return 0;
  26. }
  27.  
Advertisement
RAW Paste Data Copied
Advertisement