View Code of Problem 104

#include <stdio.h>
#include <string.h>
#include <math.h>
#define N 100000
int main()
{
	int n,v1,v2,t;
	while(scanf("%d%d%d%d",&n,&v1,&v2,&t)!=EOF)
	{
		int v_c;
		float time;
		if(v1<v2)
			printf("NO\n");
		else
		{
			time=n*1000.00/(v1-v2);
			if(time<=t)
				printf("%.2f\n",time);
			else
				printf("NO\n");
		}
	}	
	return 0;
}

Double click to view unformatted code.


Back to problem 104