View Code of Problem 104

#include<stdio.h>
#include<stdlib.h>

int main()
{
	int n, a, b;
	double t;
	while(scanf("%d%d%d%lf", &n, &a, &b, &t) != EOF)
	{
		b -= a;
		if(b >= 0)
		{
			printf("NO\n");
			continue;
		}
		t = (double)(n*1000) / b;
		if(t < 0)
			t = -t;
		printf("%.2lf\n", t);
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 104