-
Notifications
You must be signed in to change notification settings - Fork 0
/
E.cpp
34 lines (28 loc) · 798 Bytes
/
E.cpp
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
#include <bits/stdc++.h>
using namespace std;
const int MAX = 200007;
const int MOD = 1000000007;
long long a[47] = {2,3,5,7,13,17,19,31,61,89,107,127,521,607,1279,2203,2281,3217,4253,4423,9689,9941,11213,19937,21701,23209,44497,86243,110503,132049,216091,756839,859433,1257787,1398269,2976221,3021377,6972593,13466917,20996011};
long long binpow(long long a, long long b) {
a %= MOD;
long long res = 1;
while (b > 0) {
if (b & 1) {
res = res * a % MOD;
}
a = a * a % MOD;
b >>= 1;
}
return res;
}
void solve() {
int n;
cin >> n;
cout << binpow(2LL, a[n - 1] - 1) - 1 << '\n';
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
// int tt; cin >> tt; for (int i = 1; i <= tt; i++) {solve();}
solve();
}