• + 3 comments

    Similar Solution

    public class Solution {
    
        public static void main(String[] args) {
            /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
            Scanner sc = new Scanner(System.in);
            int n = sc.nextInt();
            int person = 5,count = 0;
            while(n>0){
                int interested = person / 2;
                person = interested * 3;
                count = count + interested;
                n--;
            }
            System.out.println(count);
        }
    }