View Code of Problem 32

#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<string.h>
int main(){
    float x,y;
    float a[5],b[5],c[5];
    float l;
    double dis;
    double r;
    int flag;
    while(scanf("%f %f",&x,&y)!=EOF){
 
        for(int i=0;i<5;i++){
            scanf(" %f %f %f",&a[i],&b[i],&c[i]);
        }
        scanf(" %f %lf",&l,&r);
 		flag=0;
        for(int i=0;i<5;i++){
            dis=sqrt(pow(a[i]-x,2))+pow(b[i]-y,2);
            if(dis<=l&&c[i]<=r*dis){
                flag=1;
                break;
            }
        }
        if(flag==1){
            printf("Yes\n");
        }
        else{
            printf("No\n");
        }
    }
 

}

Double click to view unformatted code.


Back to problem 32