View Code of Problem 104

#include<stdio.h>
#include <math.h>
void main()
{
	int n,v1,v2,t;
	while(scanf("%d %d %d %d",&n,&v1,&v2,&t)!=EOF)
	{
		double t1;
		if(n==0) printf("0.00\n");
		else if(v1<=v2) printf("NO\n");
		else if((v1-v2)*t<n*1000)
		{
			printf("NO\n");
		}
		else 
		{
			t1=n*1000/(v1-v2);
			printf("%.2f\n",t1);
		}	
	}
}

Double click to view unformatted code.


Back to problem 104