Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- k, m = map(int, input().split())
- counts = []
- for __ in range(k):
- counts.append(max(map(lambda x: x**2, set(map(int, input().split())))))
- print(sum(counts) % m)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement