#include #include using namespace std; using namespace atcoder; using ll = long long; using ull = unsigned long long; using ld = long double; using pii = pair; using pdd = pair; using pll = pair; using pli = pair; using pil = pair; template using Graph = vector>; const int MOD = 1e9 + 7; const ld PI = acos(-1); int main() { cin.tie(0); ios::sync_with_stdio(false); int K; cin >> K; vector cnt(1 << 16); for (int i = 0; i < (1 << 16); ++i) { cnt[i] = __builtin_popcount(i); } int ofst = 200; K += ofst; vector> dp(1 << 16, vector(505)); dp[0][ofst] = 1; for (int i = 0; i < (1 << 16); ++i) { int num = cnt[i]; for (int j = 0; j < 16; ++j) { if ((i >> j) & 1) continue; int nxt = i | (1 << j); int tmp = 0; int y = j >> 2; int x = j & 3; if (x - 1 >= 0) { tmp += ((i >> (j - 1)) & 1 ? num : -num); } if (y - 1 >= 0) { tmp += ((i >> (j - 4)) & 1 ? num : -num); } if (x + 1 < 4) { tmp += ((i >> (j + 1)) & 1 ? num : -num); } if (y + 1 < 4) { tmp += ((i >> (j + 4)) & 1 ? num : -num); } for (int k = 0; k <= 500; ++k) { if (k + tmp >= 0 && k + tmp <= 500) { dp[nxt][k + tmp] += dp[i][k]; } } } } cout << dp[(1 << 16) - 1][K] << endl; return 0; }