View Code of Problem 104

#include <stdio.h>
int main()
{
	int n,a,b,t;
	while(scanf("%d%d%d%d",&n,&a,&b,&t) != EOF)
	{
		float x;
		if(b>a)
		{
			printf("NO\n");
		}else
		{
			x=n*1000.0/(a-b);
			if(x<=t)
			{
				printf("%.2f\n",x);
			}else
			{
				printf("NO\n");
			}
		}
	} 
	return 0;
 } 

Double click to view unformatted code.


Back to problem 104