You are viewing a single comment's thread. Return to all comments →
was a bit tough and fun
from itertools import product k, m = map(int, input().split()) L, max_value = [], 0 for i in range(0, k): L.append(list(map(lambda x: int(x) ** 2, input().split()[1:]))) for i in product(*L): if max_value < (sum(i) % m): max_value = sum(i) % m print(max_value)
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 →
was a bit tough and fun