fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Ideone
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. Scanner in = new Scanner(System.in);
  10. double k,p,s,n,y;
  11. k=in.nextDouble();
  12. p=in.nextDouble();
  13. s=in.nextDouble();
  14. n=in.nextDouble();
  15. if ((k<=0)||(p<=0)||(s<=0)||(n<=0)) {System.out.printf("Неверные денные");}
  16. else {
  17. double l1=Math.log(n*s/k);
  18. double l2=Math.log(p);
  19. y = Math.ceil(l1/l2);
  20. System.out.printf("%.0f",y);
  21. }
  22. }
  23. }
Success #stdin #stdout 0.15s 321280KB
stdin
6 	10 	20 	41 	3
stdout
3