import java.util.Scanner; /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * * @author cteam063 */ public class mortgage { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int x = scanner.nextInt(); int y = scanner.nextInt(); int n = scanner.nextInt(); double r = scanner.nextDouble(); while (!(x == 0 && y == 0 && n == 0 && Math.abs(r) < 0.000001)) { if (splaceni(x, r / 12, y, n)) { System.out.println("YES"); } else { System.out.println("NO"); } x = scanner.nextInt(); y = scanner.nextInt(); n = scanner.nextInt(); r = scanner.nextDouble(); } } public static boolean splaceni(double vstupnicastka, double urok, double splatka, int roku) { double novacastka = formulka(vstupnicastka, urok, splatka, roku * 12); if (novacastka <= 0) { return true; } return false; } public static double nextMonth(double castka, double urok, double splatka) { return castka * ((100 + urok) / 100) - splatka; } public static double formulka(double castka, double urok, double splatka, int mesicu) { final double r = (urok + 100.0) / 100.0; // return castka * Math.pow(r,mesicu) - splatka*((1-Math.pow(r, mesicu)) / (1-mesicu)); return castka * Math.pow(r,mesicu) - splatka*((1-Math.pow(r, mesicu)) / (1-r)); } }