#include<iostream>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<cstdio>
#include<algorithm>
#include<string>
#include<map>
#include<queue>
#include<vector>
#include<stack>
#define ll long long
#define maxn 4001000
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define SWAP(x,y,t) ( (t)=(x),(x)=(y),(y)=(t) )
using namespace std;
const int MAX=1e5+10;
const int MOD=1e9+7;
const double PI=acos(-1.0);
struct Point
{
double x,y;
}p[MAX];
int n;
int cal(double y)
{
double l=-1e18,r=1e18;
for(int i=0;i<n;i++)
{
if(2*y<p[i].y)return 0;
//求出向左(右)延伸最长的长度
//如果写成len=sqrt(y*y-(y-p[i].y)(y-p[i].y));
//会出现严重的精度误差,所以先开根号再相乘
double len=sqrt(y-(y-p[i].y))*sqrt(y+(y-p[i].y));
l=max(l,p[i].x-len);
r=min(r,p[i].x+len);
}
return l<r;
}
int main()
{
int tag=0;
cin>>n;
for(int i=0;i<n;i++)
{
scanf("%lf%lf",&p[i].x,&p[i].y);
if(p[i].y>0)tag|=1;
if(p[i].y<0)tag|=2;
p[i].y=fabs(p[i].y);
}
if(tag==3){puts("-1");return 0;}
double l=0,r=1e18,ans=0;
for(int i=1;i<=500;i++)
{
double m=(l+r)/2;
if(cal(m))ans=r=m;
else l=m;
}
printf("%.10f
",ans);
return 0;
}