Submission
Status:
-P-P-P----
Subtask/Task Score:
30/100
Score: 30
User: Test
Problemset: โชว์ของโลมา
Language: cpp
Time: 0.003 second
Submitted On: 2025-12-30 16:24:29
#include <bits/stdc++.h>
using namespace std;
int n,ct;
void fun(int st,int 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;
}