solved hackerrank viral advertising
Signed-off-by: ayham <altffour@protonmail.com>
This commit is contained in:
parent
f1f1f52eb2
commit
011e4c0458
|
@ -0,0 +1,16 @@
|
|||
#include <bits/stdc++.h>
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
int n;
|
||||
cin >> n;
|
||||
int recipients = 5;
|
||||
int total_likes = 0;
|
||||
while (n--) {
|
||||
total_likes += floor(recipients/2);
|
||||
recipients = floor(recipients/2)*3;
|
||||
}
|
||||
cout << total_likes <<endl;
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue