Submission
Status:
-P-P-P-P-P
Subtask/Task Score:
50/100
Score: 50
User: Test
Problemset: โชว์ของโลมา
Language: cpp
Time: 0.004 second
Submitted On: 2025-12-30 16:28:01
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int n,ct;
void fun(ll st,ll dim){
if(dim==1){
ct+=st;
//cout << st%10 << "\n";
return;
}
if (dim==2){
ct+=(st+2)%10 + (st+3)%10;
//cout << (st+2) << " " << (st+3) << "\n";
return;
}
ct+=(st+3*dim-3)%10;
//cout << st+3*dim-3 << " ";
ct+=(st+3*dim-2)%10;
//cout << st+3*dim-2 << " ";
fun((st+4*dim-4),dim-2);
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
cin >> n;
fun(1,n);
cout << ct;
}