T3000

Speeding

Nov 14th, 2021
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     long long a,b,x,y,n,t,c,d;
  8.     cin>>t;
  9.     n=0;
  10.     t=t-1;
  11.     cin>>x>>y>>a>>b;
  12.  
  13.  
  14.  
  15.     while(t>0)
  16.     {
  17.         c=b-y;
  18.         d=a-x;
  19.  
  20.  
  21.         if(c/d>n)
  22.         {
  23.             n=c/d;
  24.  
  25.         }
  26.  
  27.         x=a;
  28.         y=b;
  29.         t=t-1;
  30.         if(t==0){
  31.             break;
  32.         }
  33.         cin>>a>>b;
  34.  
  35.  
  36.     }
  37.  
  38.     cout<<n<<endl;
  39.  
  40.     return 0;
  41. }
  42.  
Advertisement
Add Comment
Please, Sign In to add comment