You are viewing a single comment's thread. Return to all comments →
I went slightly different way
n, k = list(map(int, input().split())) a = list(map(int, input().split())) print (sum([(a[i]+a[j])%k==0 for i in range (n) for j in range(i+1,n)]))
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 →
I went slightly different way