文件目录

#include <iostream>
using namespace std;
int main()
{
    int n, ans = 0, f = 0;
    cin >> n;
    for (int i = 1, j = 1; i <= n; i++)
    {
        ans += j;
        f++;
        if (f == j)
        {
            f = 0;
            j++;
        }
    }
    cout << ans;
    return 0;
}
int ans1()
{
    int n;
    cin >> n;
    int s = 0;
    int c = 0;
    for (int i = 1; i <= 10000; i++)
    {
        for (int j = 1; j <= i; j++)
        {
            s += i;
            c++;
            if (c == n)
            {
                cout << s;
                return 0;
            }
        }
    }
    return 0;
}