using namespace std;
int main(){
long long k,n,ans;cin>>k;
n=(long long)(sqrt(k*2+0.25)-0.5);
ans=(k-n*(n+1)/2)*(n+1)+n*(n+1)*(2*n+1)/6;
cout<<ans;
return 0;
}
快速帮助 | 运行状态 | 反馈举报 | 关于我们 | 免责声明 | 浙ICP备11060257号 Processed in 0.0010 Second(s) Copyright (C) RQNOJ 2007-2019. All Rights Reserved.