View Code of Problem 104

#include <iostream>
using namespace std;
int main(){
	int n,v1,v2,t;
	while(cin>>n){
		n=n*1000;
		cin>>v1>>v2>>t;
			if(v1<=v2) printf("NO\n");
			else{
				double t1=n*1.0/(v1-v2);
				if(t1<t) printf("%.2lf\n",t1);
				else printf("NO\n");
			}
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 104