#include #include #include #include #include #include #include #include #include #include #include #include #include #define debug_value(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << #x << "=" << x << endl; #define debug(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << x << endl; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } using namespace std; typedef long long ll; template vector> vec2d(int n, int m, T v){ return vector>(n, vector(m, v)); } template vector>> vec3d(int n, int m, int k, T v){ return vector>>(n, vector>(m, vector(k, v))); } template void print_vector(vector v, char delimiter=' '){ if(v.empty()) { cout << endl; return; } for(int i = 0; i+1 < v.size(); i++) cout << v[i] << delimiter; cout << v.back() << endl; } const ll INF = 1e+9; using P = pair; struct edge{ int to; ll cost; }; void dijkstra(vector> G){ priority_queue, greater

> que; int n = G.size(); vector d(n, INF); int s = 0; d[s] = 0; que.push(P(0, s)); while(!que.empty()){ P p = que.top();que.pop(); int v = p.second; if(d[v] < p.first) continue; for(int i = 0; i < G[v].size(); i++){ int to = G[v][i]; if(d[v] + 1 < d[to]){ d[to] = d[v] + 1; que.push(P(d[to], to)); } } } vector dp(n); vector

vp(n); for(int i = 0; i < n; i++) vp[i] = P(d[i], i); sort(vp.begin(), vp.end()); dp[0] = 1; for(auto [_, v]: vp){ if(v == s) continue; for(int to: G[v]){ if(d[v] == d[to]+1) dp[v] += dp[to]; } } cout << dp[n-1] << endl; } int main(){ ios::sync_with_stdio(false); cin.tie(0); cout << setprecision(10) << fixed; ll a; cin >> a; int n = 121; vector

edges; vector> g(n); auto add_edge = [&](int u, int v){ if(u > v) swap(u, v); edges.push_back(P(u, v)); g[u].push_back(v); g[v].push_back(u); }; auto idx = [&](int i, int j){ return i*3+j+1; }; int s = 0; add_edge(s, idx(0, 0)); add_edge(s, idx(0, 1)); if(a%2 == 1){ add_edge(idx(0, 1), idx(0, 2)); } for(int i = 1; i < 40; i++){ for(int j = 0; j < 2; j++){ for(int k = 0; k < 2; k++){ add_edge(idx(i-1, j), idx(i, k)); } } add_edge(idx(i-1, 2), idx(i, 2)); if((1ll<