CodeForces 507B Amr and Pins(几何 水)

 

#include<cstdio>
#include<cmath>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
    double r,x,y,x1,y1;
    while(scanf("%lf%lf%lf%lf%lf",&r,&x,&y,&x1,&y1)!=EOF)
    {
        double dis=sqrt((y1-y)*(y1-y)+(x1-x)*(x1-x));
        double ans=dis/(2*r);
        if(ans-(int)ans!=0) ans++;
        printf("%d\n",(int)ans);
    }
    return 0;
}
View Code

 

posted @ 2015-01-24 16:02  sola94  阅读(151)  评论(0编辑  收藏  举报