Source Code
#include <bits/stdc++.h>

using namespace std;

#define modulo ll (1e9 + 7)
#define neig(a, u, e, v) for(int v, e = (a).head[u] ; ~e and (v = (a).to[e], 1) ; e = (a).nxt[e])

typedef long long ll;

const int N = 2e5 + 9, M = 1e6 + 9, OO = 0x3f3f3f3f;
const ll llOO = 0x3f3f3f3f3f3f3f3f;


int main() {
    cin.tie(0);
    cin.sync_with_stdio(0);

    ll x;   cin >> x;

    vector<ll> v;
    ll n = 1;
    while(n <= x){
        v.push_back(n);
        x -= n;
        n++;
    }

    if(x)
        v[v.size() - 1] += x;

    cout << v.size() << '\n';
    for(auto z : v)
        cout << z << " ";
}
Copy
Want More! Muhammad
GNU G++17
167 ms
22.3 MB
Accepted