You are viewing a single comment's thread. Return to all comments →
from itertools import product k, m = map(int, input().split()) x = [(list(map(lambda x: int(x)**2, input().split()))[1:]) for _ in range(k)] print(max(list(map(lambda x: x % m, list(map(sum, product(*x)))))))
Seems like cookies are disabled on this browser, please enable them to open this website
Maximize It!
You are viewing a single comment's thread. Return to all comments →