//csu oj 1539 space golf
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#define maxn 20000
#define inf 0x3f3f3f
using namespace std;
struct node
{
double x,y;
}p[maxn];
double Min(double a,double b)
{
if(a>b) return b;
else return a;
}
double Max(double a,double b)
{
if(a>b) return a;
else
return b;
}
int main()
{
int n,b;
double d;
while(scanf("%lf%d%d",&d,&n,&b)!=EOF)
{
double m=inf;
for(int i=1;i<=n;i++)
scanf("%lf%lf",&p[i].x,&p[i].y);
for(int j=0;j<=b;j++)
{
double mi=0;
double l=d/(double)(j+1);
double miao=l/4.0;
double tmp=sqrt((l*l/(8.0*miao))+2*miao);
for(int i=1;i<=n;i++)
{
int tmp=p[i].x/l;
double xx=p[i].x-(double)tmp*l;
double ans1=(xx-l/2.0)*(xx-l/2.0);
ans1=(ans1*4.0)/(l*l);
ans1=1-ans1;
ans1=p[i].y/ans1;
double temp=sqrt((l*l/(8.0*ans1))+2*ans1);
mi=Max(ans1,mi);
}
mi=Max(mi,l/4.0);
double res=sqrt((l*l/(8.0*mi))+2*mi);
m=Min(m,res);
}
printf("%.6lf\n",m);
}
}
csu oj 1539 数学公式
最新推荐文章于 2020-12-12 11:21:59 发布