#include<iostream> #include<iomanip> using namespace std; int main() { int n, v1, v2, t; while (cin >> n>> v1 >> v2 >> t) { n *= 1000; if (t*(v2 - v1) > -n) cout << "NO" << endl; else cout <<fixed<<setprecision(2)<<(double)n / (v1 - v2) << endl; } } |
Double click to view unformatted code.