Skip to content

Instantly share code, notes, and snippets.

@VxDxK
Created April 7, 2021 16:17
Show Gist options
  • Save VxDxK/00b75aa8c2bbd8ff0e6a090983c76274 to your computer and use it in GitHub Desktop.
Save VxDxK/00b75aa8c2bbd8ff0e6a090983c76274 to your computer and use it in GitHub Desktop.
f = open("test.txt")
def get():
return list( map(int, f.readline().split()))
n = int(f.readline())
s = get()
for i in range(n - 1):
para = get()
cmb = [a + b for a in s for b in para]
#print(cmb)
s1 = [0] * 10
for x in cmb:
if x > s1[x % 10]:
s1[x % 10] = x
s = [x for x in s1 ]
print(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment