python
2025-07-06 08:12:14
发布于:浙江
1阅读
0回复
0点赞
def find_excellent_split(n):
if n % 2 == 1:
return [-1]
split_result = []
for k in range(23, 0, -1):
power = 2 ** k
if power <= n:
split_result.append(power)
n -= power
if n == 0:
return split_result
else:
return [-1]
n = int(input())
result = find_excellent_split(n)
if result[0] == -1:
print(-1)
else:
print(' '.join(map(str, result)))
这里空空如也
有帮助,赞一个