Last active
December 20, 2021 23:29
-
-
Save kaathewise/903adbab6d61dbde3a7ca5b41c601f7b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print(max(next(filter(None,(g(b[v]%5) or g(b.pop(v)//5+5) or max(c)==5 and (i,sum(map(int,b.keys()))*int(v)) for i,v in enumerate(d) if v in b))) for f in [open(0)] for d in [next(f).strip().split(',')] for b in [{k:i for i,k in enumerate(b)} for b in zip(*[iter(f.read().split())]*25)] for c in [[0]*10] for g in [lambda i:c.__setitem__(i,c[i]+1)])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment