Advertisement
DanikYakush

Task16

Jul 4th, 2022
822
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Task16 {
  4.     public static void main(String[] args) {
  5.         int n;
  6.         int e;
  7.         int res = 0;
  8.         Scanner in = new Scanner(System.in);
  9.         n = in.nextInt();
  10.         e = in.nextInt();
  11.         if(Math.pow(0.5, n) > e) res += Math.pow(0.5, n);
  12.         if(Math.pow(0.333, n) > e) res += Math.pow(0.333, n);
  13.         System.out.println(res);
  14.  
  15.     }
  16. }
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement