Submission

Status:
[PPPPPPPPPP]

Score: 100

User: Namkhing

Problemset: นักบินอวกาศ

Language: cpp

Time: 0.002 second

Submitted On: 2025-04-10 23:35:02

#include <bits/stdc++.h>
using namespace std;

using ll = long long;

const int N = 500;
ll n, dp[N];

int main() {
    cin.tie(nullptr)->ios_base::sync_with_stdio(false);
    cin >> n;
    dp[0] = 0;
    for (int i = 1, now = 4; i <= n; i++, now += 6) {
        dp[i] = dp[i-1] + now;
    }
    cout << dp[n];
}