with open("input.txt", "r") as file:
x, y, z, w = [int(x) for x in next(file).split()]
count = 0
for i in range(0, w // x + 1):
rest = w - x * i
for j in range(0 , rest // y + 1):
if (rest - y * j) % z == 0:
count += 1
with open("output.txt", "w") as file:
file.write(str(count))
def example(*args):
for i in args:
for t in i:
print(t)
example([1,55,73], [2,95,93]);
Main_List = [[[2]], [4, [5, 6, [6], 6, 6, 6], 7]]
def flatten(lst):
while lst:
sublist = lst.pop(0)
if isinstance(sublist, list):
lst = sublist + lst
else:
yield sublist
print(list(flatten(Main_List)))