11 lines
333 B
Python
Executable File
11 lines
333 B
Python
Executable File
#!/usr/bin/env python3
|
|
from itertools import permutations
|
|
with open('input', 'r') as f:
|
|
content = list(map(int, (map(str.strip, f.readlines()))))
|
|
perms = permutations(content, 2)
|
|
|
|
for perm in perms:
|
|
perm_sum = perm[0] + perm[1]
|
|
if perm_sum == 2020:
|
|
print('{} * {} = {}'.format(perm[0], perm[1], perm[0]*perm[1]))
|