scripts/ege/Вариант ДЗ/14.py

19 lines
380 B
Python
Raw Normal View History

2023-05-15 13:25:06 +03:00
def _(n, p, d=16):
return n * d ** (p - 1)
r = []
for x in range(16):
for y in range(16):
for z in range(1000):
n1 = _(5, 4) + _(x, 1) + 7
n2 = _(3, 2) + _(y, 1) + 1
n3 = _(1, 6, z) + _(2, 5, z) + _(6, 1, z) + 5
if n1 + n2 == n3:
print(x, y, z)
r.append(x * y * z)
print(max(r))