Submission
Status:
PPPPPPPPPP
Score: 100
User: yumiKuri
Problemset: โชว์ของโลมา
Language: cpp
Time: 0.002 second
Submitted On: 2025-03-23 13:04:30
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(0), cin.tie(0);
int n;
cin >> n;
int sum = 0;
long long start = 0;
while(true){
if(n <= 2){
if(n == 2){
sum += (start+3)%10;
sum += (start+4)%10;
}
else{
sum += (start+1)%10;
}
break;
}
start += n*2 + (n-2);
sum += start%10 + (start+1)%10;
start += n-2;
n -= 2;
}
cout << sum;
}