706A Codeforces - Beru-taxi




Solution in c++

#include <bits/stdc++.h>

using namespace std;

double bst=1000000.0,sol;

int me_x,me_y,n;


int velo (int x,int y,int spd){

sol=1.0*sqrt( pow(me_x-x,2) + pow(me_y-y,2) )/spd;
bst=min(bst,sol);

}

int main()
{
    int a,b,c;
    cin>>me_x>>me_y;
    cin>>n;
    while(n--)
    {
        cin>>a>>b>>c;
        velo(a,b,c);
    }
    cout<<fixed<<setprecision(20)<<bst;
    return 0;
}

Share on Google Plus

About Mohamed Sobhi

My name is Mo.Sobhy ,I study at School excelling high school in Ain Shams ,Cairo
My hobbies is programming ,and web development ,playing chess and writing horror stories.
    Blogger Comment
    Facebook Comment

0 التعليقات:

إرسال تعليق