View Code of Problem 32

#include<stdio.h>
#include<math.h>
typedef struct{
	int x1;
	int y1;
	int hp;
}PE;
int main()
{
	int x,y;
	while(scanf("%d %d",&x,&y)!=EOF)
	{
		PE p[5];
		int l;
		double r;
		for(int i=0;i<5;i++)
		{
			scanf("%d %d %d",&p[i].x1,&p[i].y1,&p[i].hp);
		}
		scanf("%d %lf",&l,&r);
		int j;
		for(j=0;j<5;j++)
		{
			if(p[j].hp<=r*(sqrt((p[j].x1-x)*(p[j].x1-x)+(p[j].y1-y)*(p[j].y1-y))))
			{
			   printf("Yes\n");
			   break;
			}
			 
		}
		if(j==5)
		 printf("No\n");
		
	}
}

Double click to view unformatted code.


Back to problem 32