mirror of
https://github.com/wczffl-503/OI-Codes.git
synced 2025-05-10 16:20:27 +08:00
18 lines
197 B
C++
18 lines
197 B
C++
#include <iostream>
|
|
#include <cmath>
|
|
using namespace std;
|
|
int main(){
|
|
int a,b=1,sum=0;
|
|
cin >>a;
|
|
while(a>b){
|
|
sum+=b*b;
|
|
a-=b;
|
|
b++;
|
|
}
|
|
sum+=b*a;
|
|
cout <<sum;
|
|
return 0;
|
|
}
|
|
|
|
|