Source Code
x = int(input())

best = 1
for i in range(2, x):
    if i*(i+1)/2 <= x:
        best = i
    else:
        break

x -= best*(best-1)/2
l = list(range(1, best))

if x != 0:
    l.append(int(x))

print(len(l))
print(" ".join(map(str, l)))
Copy
Want More! yamen
Python 3
1090 ms
76.5 MB
Time Limit Exceeded