You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
547 B
C++

#include <cstdio>
#include <utility>
#include <algorithm>
using namespace std;
const int N=10005;
pair<int,int> a[N];
int main()
{
int T,n,t=0;
scanf("%d",&T);
while(T--)
{
scanf("%d",&n);
for(int i=0; i<n; i++)
scanf("%d%d",&a[i].first,&a[i].second);
sort(a,a+n);
double ans=0;
for(int i=1; i<n; i++)
ans=max(ans,1.0*abs(a[i].second-a[i-1].second)/(a[i].first-a[i-1].first));
printf("Case #%d: %.2lf\n",++t,ans);
}
return 0;
}