Home

Viral Advertising

Detailed explanation coming soon!

import java.util.*;

public class Solution {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();

        int people = 5;
        int totalLikes = 0;
        for(int i = 0; i < n; i++){
            int liked = people / 2;
            totalLikes += liked;
            people = liked * 3;
        }

        System.out.println(totalLikes);
    }
}


Questions? Have a neat solution? Comment below!