const int N=1e6+5;
int n;
double m,t;
int i,j,k;
pair<double,double> p[N];
double C(double x){ //計算第 n 位與其餘選手的耗時之差
double ans=inf;
double t1=x/p[n-1].first+(m-x)/p[n-1].second;
for(i=0;i<n-1;i++){
double t2=x/p[i].first+(m-x)/p[i].second;
ans=min(ans,t2-t1);
}
return ans;
}
int main()
{
//IOS;
while(~sf(m)){
sd(n);
for(i=0;i<n;i++){
sf(p[i].first);
sf(p[i].second);
}
double l=0,r=m;
while(r-l>E){
double l_mid=(l+r)/2.0;
double r_mid=(l_mid+r)/2.0;
if(C(l_mid) > C(r_mid)) r=r_mid; //先遞增後遞減函數
else l=l_mid;
}
t=C(l);
if(t<0){ printf("The cheater cannot win.\n"); }
//超過的時間,以及前半段和後半段的路程
else printf("The cheater can win by %.0lf seconds with r = %.2lfkm and k = %.2lfkm.\n",t*3600,l,m-l);
}
//PAUSE;
return 0;
}