Source Code
from math import sqrt, floor
x = int(input())

best = floor((-1 + sqrt(1+(8*x)))/2)

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
139.0 MB
Time Limit Exceeded