/* * To change this template, choose Tools | Templates * and open the template in the editor. */ import java.util.ArrayList; import java.util.Scanner; /** * * @author vaskol */ public class mortgage { /** * @param args the command line arguments */ public static void main(String[] args) { String vstup = ""; ArrayList zoz = new ArrayList(); Scanner scan = new Scanner(System.in); vstup = scan.nextLine(); while (vstup.compareTo("0 0 0 0") != 0) { zoz.add(vstup); vstup = scan.nextLine(); }; for (String jeden : zoz) { String[] vysledok = jeden.split(" "); int x = Integer.parseInt(vysledok[0]); int s = Integer.parseInt(vysledok[1]); int pocet = Integer.parseInt(vysledok[2]); float dan = Float.parseFloat(vysledok[3]); float pompocet = x; boolean help = false; for(int i=0;i< pocet*12;i++){ pompocet = pompocet - s; pompocet += (pompocet*(dan/100/12)); if(pompocet <= 0) {System.out.println("YES");help = true;break;} } if(help == false) System.out.println("NO"); } } }