-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path630I.cpp
More file actions
39 lines (38 loc) · 753 Bytes
/
630I.cpp
File metadata and controls
39 lines (38 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <bits/stdc++.h>
#define mod 1000000007
#define FOR(i, a, b) for (i = a; i < b; i++)
using namespace std;
typedef long long ll;
void printV(vector<ll> v)
{
for (int i = 0; i < v.size(); i++)
cout << v[i] << " ";
}
int modexp(ll A, ll B, ll C)
{
if (A == 0)
return 0;
if (B == 0)
return 1;
ll y;
if (B % 2 == 0)
{
y = modexp(A, B / 2, C);
y = (y * y) % C;
}
else
{
y = A % C;
y = (y * modexp(A, B - 1, C) % C) % C;
}
return (ll)((y + C) % C);
}
int main()
{
ll n, t1 = 0, t2 = 0;
cin >> n;
t1 = 24 * (ll)(pow(4, n - 3) + 0.5);
if (n - 3 > 0)
t2 = (n - 3) * 36 * (ll)(pow(4, n - 4) + 0.5);
cout << (t1 + t2) << '\n';
}