Submission
Status:
----------
Score: 0
User: hmmm
Problemset: โชว์ของโลมา
Language: cpp
Time: 0.011 second
Submitted On: 2025-03-13 13:55:31
#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(0); cin.tie(0);
int n,ans=0,to=0;
cin >> n;
int cnt=n;
while(cnt>=4){
to+=cnt*2;
to+=cnt-2;
ans+=to%10;
ans+=(to+1)%10;
cout << to%10 << ' ' << (to+1)%10 << ' ' << cnt << "\n";
to+=cnt-2;
cnt-=2;
// to++;
}
ans+=(n*n)%10+(n*n-1)%10;
cout << ans;
}