View Code of Problem 104

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

Double click to view unformatted code.


Back to problem 104