五家共井,甲二绠(汲水用的井绳)不足,如(接上)乙一绠;乙三绠不足,如丙一绠;丙四绠不足,如丁一绠;丁五绠不足,如戊一绠;戊六绠不足,如甲一绠,皆及
# encoding: utf-8
for k in range(1, 5):
for e in range(1, 500):
a = 721 * k - 6 * e
b = 721 * k - 2 * a
c = 721 * k - 3 * b
d = 721 * k - 4 * c
e = 721 * k - 5 * d
result1 = a + 6 * e
result2 = b + 2 * a
result3 = c + 3 * b
result4 = d + 4 * c
result5 = e + 5 * d
if result1 == result2 == result3 == result4 == result5:
print('井深%d:甲家绳长%d乙家绳长%d丙家绳长%d丁家绳长%d戊家绳长%d' % (result1, a, b, c, d, e))
戊家的绳子是最短的,所以以e为循环单位,第二组解算出来就非常吓人了·····
井深721:甲家绳长265乙家绳长191丙家绳长148丁家绳长129戊家绳长76
井深1442:甲家绳长530乙家绳长382丙家绳长296丁家绳长258戊家绳长152