Maximize It!

  • + 1 comment

    Did I misunderstood the problem??

    # Enter your code here. Read input from STDIN. Print output to STDOUT
    k,m=map(int, input().split(" "))
    li=[]
    for i in range(1,k+1):
        li.append((max(list(map(int, input().split()))))**2)
    print(sum(li)%m)
    

    What I did here is I took the max element out of all k lists provided, summed up the square value of the element(s) and as said applied modular with m. Am I missing something? Please explain if I misunderstood the problem. Thx.