This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
range = xrange
n = int(raw_input())
div = set()
for i in range(1, 100000):
if n%i: continue
div|= {i, n//i}
div = sorted(div)
dp = {}
def add(n):
if n == 1: return {0}
if n in dp: return dp[n]
ans = set()
for d in div:
if d == 1 or n%d: continue
ans|= {d-1+x for x in add(n//d)}
dp[n] = ans
return ans
S = add(n)
print(len(S))
for x in sorted(S): print x,
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |