View Code of Problem 32

#include<stdio.h>
#include<math.h>
void main()
{
	int x[5],y[5],hp[5];
	double t[5];
	int X,Y;
	while(scanf("%d %d",&X,&Y)!=EOF)
	{
		int i,L;
		double R;
		for(i=0;i<5;i++)
		{
			scanf("%d %d %d",&x[i],&y[i],&hp[i]);
		}
		scanf("%d %lf",&L,&R);
		for(i=0;i<5;i++)
		{
			t[i]=sqrt(pow(x[i]-X,2)+pow(y[i]-Y,2));
		}
		int flag=0;
		for(i=0;i<5;i++)
		{
			if(t[i]<=L&&R*t[i]>hp[i])
			{
					flag=1;
					break;
			}
		}
		if(flag==0)
		{
			printf("No\n");
		}else
		{
			printf("Yes\n");
		}
	}
} 

Double click to view unformatted code.


Back to problem 32