Submission

Status:

[PPPPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: c_sonephu

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

Language: cpp

Time: 0.003 second

Submitted On: 2025-11-26 22:47:21

#include <bits/stdc++.h>
using namespace std;
int main() {
    int n; cin >> n;
    int height[n+1] = {0};
    height[0] = 0;
    for (int i = 1 ; i <= n ; i++) {
        height[i] = height[i-1] + 4 + (6 * (i-1));
        //cout << height[i] << " ";
    }
    cout << height[n];
}