View Code of Problem 32

//
// Created by xjp on 2022/2/28.
//
#include<bits/stdc++.h>
using namespace std;
int main(){
    int i;
    int X,Y;
    int x[5],y[5],hp[5];
    while(cin>>X>>Y){
        for( i=0;i<5;i++) cin>>x[i]>>y[i]>>hp[i];
        int L;
        double s;
        double R;
        cin>>L>>R;
        int flag=0;
        for(i=0;i<5;i++){
            s=sqrt(pow(X-x[i],2))+pow(Y-y[i],2);
            if(s<=L&&hp[i]<=R*s){
                flag=1;
                break;
            }
        }
        if(flag==1) cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
    return 0;
}

Double click to view unformatted code.


Back to problem 32