#pragma GCC optimized("-O3")
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define lf __float128
#define pb push_back
#define x first
#define y second
int n;
const int N=2e5+5;
ld x[N],y[N];
ld efs=1e-15;
bool f(lf r){
    ld minx,maxx; 
    minx=-1e12,maxx=1e12;
    int i;
    for(i=1;i<=n;i++){
        lf val;
        val=fabs((ld)r-y[i]);
        if(y[i]>r+r)
            return 0;
        ld temp;
        temp=((r*r)-(val*val));
        temp=sqrt(temp);
        minx=max(minx,x[i]-temp);
        maxx=min(maxx,x[i]+temp);
    }
    return minx<=(maxx+efs);
}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int i;
    //assert(freopen("input.txt","r",stdin));
    //assert(freopen("output.txt","w",stdout));
    cin>>n;
    int f1=0,f2=0;
    for(i=1;i<=n;i++){
        cin>>x[i]>>y[i];
        if(y[i]<0)
            f2++;
        if(y[i]>0)
            f1++;
        y[i]=fabs(y[i]);
    }
    //cout<<f1<<" "<<f2;
    if(f1*f2){
        cout<<-1;
        return 0;
    }
    ld l=0,r=1e18;
    //cout<<f(0);
    for(i=(n>100?55:200);i;i--){
        lf mid;
        mid=(l+r)/2;
        if(f(mid))
            r=mid;
        else
            l=mid;
    }
    cout<<fixed<<setprecision(20);
    cout<<(l+r)/2;
    return 0;
}