diff --git a/31xxx/31000.cpp b/31xxx/31000.cpp new file mode 100644 index 00000000..b1c863f1 --- /dev/null +++ b/31xxx/31000.cpp @@ -0,0 +1,23 @@ +#include +using namespace std; + +void solve(void) { + int n; cin >> n; + + int ans = (2*n+1)*(2*n+1); + for (int a=-n; a<=n; a++) { + if (a == 0) continue; + for (int b=-n; b<=n; b++) { + if (-n <= 1-a-b && 1-a-b <= n) ans++; + } + } + cout << ans; +} + +int main(void) { + ios::sync_with_stdio(false); + cin.tie(nullptr); + + solve(); + return 0; +} \ No newline at end of file