#include #include #include #define rep(i, n) for(i = 0; i < n; i++) #define int long long using namespace std; typedef pair P; int C = 50; int dist[100][100]; int dy[5] = {1, 1, 1, -1, -1}; int dx[5] = {-1, 0, 1, -1, 1}; void jikken(int n) { int i, j; rep(i, 100) rep(j, 100) dist[i][j] = -1; queue

que; dist[C][C] = 0; que.push(P(C, C)); while (!que.empty()) { P now = que.front(); que.pop(); rep(i, 5) { int ny = now.first + dy[i]; int nx = now.second + dx[i]; if (dist[ny][nx] == -1 && dist[now.first][now.second] < n) { dist[ny][nx] = dist[now.first][now.second] + 1; que.push(P(ny, nx)); } } } int ans = 0; for (i = C - n; i <= C + n; i++) { for (j = C - n; j <= C + n; j++) { if (dist[i][j] == -1) cout << "-"; else cout << dist[i][j]; cout << " "; if (dist[i][j] != -1) ans++; } cout << endl; } cout << (2 * n + 1) * (2 * n + 1) - ans << endl; } signed main() { int n; cin >> n; //jikken(n); cout << (2 * n + 1) * (2 * n + 1) - (4 * n - 1) << endl; return 0; }