#include<stdio.h>
int main() {
int n, val = 0, temp = 0, day = 0;
scanf("%d", &n);
while (day < n) {
day += ++temp; //计算叠加金币天数
if (n - day >= 0) //判断天数是否超出给定值n
val += temp * temp; //不超出金币正常获取
else
//超出金币获取值为 金币值 * 未超出天数值
val += temp * (temp - (day - n));
}
printf("%d", val);
return 0;
}
int main() {
int n, val = 0, temp = 0, day = 0;
scanf("%d", &n);
while (day < n) {
day += ++temp; //计算叠加金币天数
if (n - day >= 0) //判断天数是否超出给定值n
val += temp * temp; //不超出金币正常获取
else
//超出金币获取值为 金币值 * 未超出天数值
val += temp * (temp - (day - n));
}
printf("%d", val);
return 0;
}