You are viewing a single comment's thread. Return to all comments →
from itertools import product
num,num1=input().split()
list1=[]
for i in range(int(num)):
k,*list_value=list(map(int,input().split())) list1.append(list_value)
max_value=0
for cury in product(*list1):
tatal_val=sum(x**2 for x in cury)%int(num1) max_value=max(max_value,tatal_val)
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 →
from itertools import product
num,num1=input().split()
list1=[]
for i in range(int(num)):
max_value=0
for cury in product(*list1):
print(max_value)