6 lines
251 B
Python
6 lines
251 B
Python
nums = [int(l) for l in open("input", "r").read().split("\n") if l]
|
|
target = 542529149
|
|
sets = sum([[nums[i:x] for x in range(i+2, len(nums))] for (i, n) in enumerate(nums)], [])
|
|
valid = [min(s) + max(s) for s in sets if sum(s) == target]
|
|
print(valid)
|