duplicating Charlie's result
The number of distinct solutions is 465
The smallest is 376
The largest is 1786
----
ans_list = []
for x in range(0,95): # (x can be from 0 through 94 inclusive)
for y in range(0,95):
if 94-x-y >= 0:
z = 94-x-y
H = 4*x+10*y+19*z
if H not in ans_list:
ans_list.append(H)
print('The number of distinct solutions is',len(ans_list))
print('The smallest is',min(ans_list))
print('The largest is',max(ans_list))
|
Posted by Larry
on 2020-09-10 04:39:16 |