#pragma region include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //#include #include #pragma endregion //#include ///////// #define REP(i, x, n) for(int i = x; i < n; ++i) #define rep(i,n) REP(i,0,n) #define ALL(X) X.begin(), X.end() ///////// #pragma region typedef typedef long long LL; typedef long double LD; typedef unsigned long long ULL; typedef std::pair PLL;// typedef std::pair PII;// #pragma endregion //typedef ////定数 const int INF = (int)1e9; const LL MOD = (LL)1e9+7; const LL LINF = (LL)1e18+20; const LD PI = acos(-1.0); const double EPS = 1e-9; ///////// using namespace::std; /* http://www.iwriteiam.nl/Crook_path.html http://www.iwriteiam.nl/counting.html 意味は分からない */ map memo; LL f(LL n){ if( memo.find(n) != memo.end() ){ return memo[n]; } LL ans = 0; ans = (f(n-1)*12) % MOD; ans = (ans+f(n-3)*124) % MOD; ans = (ans+f(n-6)*175) % MOD; ans = (ans+f(n-9)*40) % MOD; ans = (ans+f(n-10)*12) % MOD; LL res = (f(n-2)*54) % MOD; res = (res+f(n-4)*133) % MOD; res = (res+f(n-5)*16) % MOD; res = (res+f(n-7)*94) % MOD; res = (res+f(n-8)*69) % MOD; res = (res+f(n-11)*4) % MOD; res = (res+f(n-12)) % MOD; res = (MOD - res) % MOD; ans = (ans+res) % MOD; memo[n] = ans; return ans; } void solve(){ LL N; cin >> N; ++N; memo[1] = 1; memo[2] = 8; memo[3] = 38; memo[4] = 184; memo[5] = 976; memo[6] = 5382; memo[7] = 29739; memo[8] = 163496; memo[9] = 896476; memo[10] = 4913258; memo[11] = 26932712; memo[12] = 147657866; cout << f(N) << endl; } #pragma region main signed main(void){ std::cin.tie(0); std::ios::sync_with_stdio(false); std::cout << std::fixed;//小数を10進数表示 cout << setprecision(16);//小数点以下の桁数を指定//coutとcerrで別 solve(); } #pragma endregion //main()