You are viewing a single comment's thread. Return to all comments →
Use Python 3:
n, k = list(map(int, input().split())) a = list(map(int, input().split())) b = [[c, d] for x, c in enumerate(a) for y, d in enumerate(a) if x < y and (c + d) % k == 0] print(len(b))
Seems like cookies are disabled on this browser, please enable them to open this website
Divisible Sum Pairs
You are viewing a single comment's thread. Return to all comments →
Use Python 3: