View Code of Problem 104

#include <iostream>
#include <cstdio>
#include <iomanip>
using namespace std;
int main(){
    double n,v1,v2,t;
    while(cin>>n>>v1>>v2>>t){
    if(v2>v1)
        cout<<"NO"<<endl;
    else{
        if(n*1000/(v1-v2)<=t)
            cout<<fixed<<setprecision(2)<<n*1000/(v1-v2);
        else
            cout<<"NO"<<endl;
        }
    }
    return 0;
}



Double click to view unformatted code.


Back to problem 104