Submission

Status:

[PPPPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: Field

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

Language: cpp

Time: 0.002 second

Submitted On: 2026-05-09 11:57:17

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,ans = 0,s = 0;
	cin >> a;
	for(int  i = 1;i <= a;i++)
	{
		if(a == 0)
		{
			cout << 0;
			return 0;
		}
		else if(a == 1)
		{
			cout << 4;
			return 0;
		}
		else
		{
			ans = 4;
			ans += (i-1)*6;
			s += ans;
		}
	}
	cout << s;
	
}