Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- pair<int,int>a[100000];
- int test,n,i,j,k,b,c,d,e,f;
- cin>>test;
- for(k=1;k<=test;k++)
- {
- cin>>n;
- for(i=0;i<n;i++)
- cin>>a[i].first>>a[i].second;
- sort(a,a+n);
- double max=0.0;
- for(i=1;i<n;i++)
- {
- int time=abs(a[i].first-a[i-1].first);
- int spot=abs(a[i].second-a[i-1].second);
- double ans=(double)spot/time;
- if(ans>max)
- max=ans;
- }
- printf("Case #%d: %.2lf\n",k,max);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement