题解 | #尼科彻斯定理#
尼科彻斯定理
http://www.nowcoder.com/practice/dbace3a5b3c4480e86ee3277f3fe1e85
def myfunc(x):
result = []
y = int(pow(x, 3) / x)
if x % 2 == 0:
for i in range(x//2):
temp_1 = y - 1 - 2*i
result.append(temp_1)
temp_2 = y + 1 + 2*i
result.append(temp_2)
else:
result.append(y)
for i in range(x//2):
temp_1 = y - 2 - 2*i
result.append(temp_1)
temp_2 = y + 2 + 2*i
result.append(temp_2)
return result
while True:
try:
a = int(input())
b = myfunc(a)
b.sort()
print(*b,sep="+")
except:
break