Accepted
正在同步测试数据,请稍后 [Hydro](https://hydro.ac)提供评测服务
代码
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
int M,N=1,sum=1,count=0,i;
cin>>M;
while(sum<M)
{
N++;
sum+=N;
}
for(i=1;i<=N;i++)
{
if(i<N)
count+=pow(i,2);
else
count+=(N-(sum-M))*N;
}
cout<<count;
return 0;
}