// // File: mortgage.cc // Author: cteam044 // // Created on October 22, 2011, 3:34 PM // #include #include #include #include // // // double EPS = 10e-8; int main(int argc, char** argv) { double X, Y, r, g; int N; while (1) { start: scanf("%lf %lf %d %lf", &X, &Y, &N, &r); g = 1+ ( r / 100 ) / 12; //printf("%f %f %d %f\n", X, Y, N, g); if (X==0) break; for(int i = 0; i < N; i++) for(int j = 0; j < 12; j++) { //printf("%f * %f - %f = %f\n", X, g, Y, X * g - Y ); X = X * g - Y; //printf("%f\n", X); if(X < EPS) {printf("YES\n"); goto start;} } printf("NO\n"); } return (0); }