/* * mortgage.c * * Copyright 2011 Contest Team 19 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include int main(int argc, char** argv) { int Y, N, i; double r, X; double EPS = 10E-8; while (1) { scanf ("%lf %d %d %lf", &X, &Y, &N, &r); if (X <= EPS && Y <= EPS && N <= EPS && r <= EPS) { break; } r = r / 12 / 100; // urok za mesic (v procentech) N = N * 12; // roky na mesice for (i = 0; i < 1; i ++) { X += (X * r); //printf ("X po zuroceni = %lf\n", X); X -= Y; //printf ("X = %lf\n", X); } if (X <= 0) printf ("YES\n"); else printf ("NO\n"); } return 0; }