#include #include using std::cin; using std::cout; using std::endl; double formulka(double castka, double urok, double splatka, int mesicu) { const double r = (urok + 100.0) / 100.0; return castka * pow(r, mesicu) - splatka * ((1 - pow(r, mesicu)) / (1 - r)); } bool splaceni(double vstupnicastka, double urok, double splatka, int roku) { double novacastka = formulka(vstupnicastka, urok, splatka, roku * 12); if (novacastka <= 0) { return true; } return false; } int main() { int x; int y; int n; double r; cin >> x; cin >> y; cin >> n; cin >> r; while (! (x == 0 && y == 0 && n == 0 && r == 0)) { if( splaceni(x, r / 12, y, n) ) { cout << "YES" << endl; } else { cout << "NO" << endl; } cin >> x; cin >> y; cin >> n; cin >> r; } }