排序后乱搞
#include<bits/stdc++.h>
#define int long long
#define endl "\n"
#define double long double
using namespace std;
int n;
struct opl{
int x,h;
}a[200001];
bool cmp(opl x,opl y){
return x.h<y.h;
}
double ans = -1;
void calc(int l,int r){
if(l==r)return;
if(a[l].x>a[r].x)swap(l,r);
double k = (a[r].h-a[l].h)*1.0/(a[r].x-a[l].x);
ans = max(ans,a[l].h-k*a[l].x);
return;
}
signed main(){
cin.tie();
cout.tie();
srand(time(0));
cin>>n;
for(int i = 1;i<=n;i++){
cin>>a[i].x>>a[i].h;
for(int j = i-1;j>=max((int)1,i-300);j--){
calc(i,j);
}
}
for(int i = 1;i<=min((int)200,n);i++){
for(int j = n;j>=max((int)1,n-200);j--){
calc(i,j);
}
}
int opl = 8*1e6,l,r;
// while(opl--){
// //cout<<"op:"<<opl<<endl;
// if(rand()%7==0){
// r = rand()%(min(n,(int)20000))+2;
// }else{
// r = n-rand()%(min(n-1,(int)50000));
// }
// l = rand()%(r-1)+1;
// //cout<<l<<" "<<r<<endl;
// if(l>=r or r>n or r<1)continue;
// calc(l,r);
// }
sort(a+1,a+1+n,cmp);
for(int i = 1;i<=min((int)3000,n);i++){
for(int j = n;j>=max((int)1,n-3000);j--){
calc(i,j);
}
}
if(ans<0){
cout<<-1<<endl;
return 0;
}
cout<<fixed<<setprecision(15)<<ans<<endl;;
return 0;
}