Viral Like Count

An ad spreads through friends as a simple viral chain. On the first day, 5 people see it: half of them, rounded down, like it, and each person who likes it shares it with 3 new people the next day. The function viral_advertising receives the number of days n. Return the total number of likes accumulated across all days.

Примеры

Ввод
1
Вывод
2
Ввод
2
Вывод
5
Ввод
3
Вывод
9

Нужно реализовать

def viral_advertising(n: int) -> int:

Теги

math
PostgreSQLv16

Siia ilmub koodi käivituse tulemus

Visible tests
1
Input
1
Expected2
2
Input
2
Expected5
3
Input
3
Expected9
4
Input
5
Expected24
5
Input
4
Expected15
6
Input
-1
Expected0
Focus radio
Paused · SomaFM · Fluid