#include<bits/stdc++.h> using namespace std; int main() { int x, y, n, p; cin >> x >> y >> n >> p; double a, b; if (p >= x) { a = p - y; } else { a = p; } b = p * n / 10.0; cout << fixed << setprecision(2) << min(a, b); return 0; }
By signing up a Hydro universal account, you can submit code and join discussions in all online judging services provided by us.
Using your Hydro universal account