Submission

Status:

[PPPPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: Nuttykub

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

Language: cpp

Time: 0.003 second

Submitted On: 2026-10-01 16:45:29

#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int n;
    cin >> n;
    if (n==0) {
        cout << 0;
        return 0;
    }
    else if (n==1){
        cout << 4;
        return 0;
    }
    int i = 0;
    int j = 4;
    int k = 0;
    while(true){
        i+=j;
        j+=6;
        k++;
        if (k == n) break;
    }
    cout << i;
}