#include #include #include using std::cin; using std::cout; using std::endl; using std::abs; double formulka(int castka, double urok, int 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(int vstupnicastka, double urok, int splatka, int roku) { double novacastka = formulka(vstupnicastka, urok, splatka, roku * 12); if (novacastka <= 0.00000001) { 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 && fabs(r) < 0.0000001)) { if( splaceni(x, r / 12, y, n) ) { cout << "YES" << endl; } else { cout << "NO" << endl; } cin >> x; cin >> y; cin >> n; cin >> r; } return 0; }