def main(): N,K = map(int,input().split()) #global K C = list(map(int,input().split())) A = [] for i in range(N): for j in range(C[i]): A.append(i+1) #print(A) MAX = 200000 popcount = [0]*MAX for i in range(1,MAX): popcount[i] = popcount[i//2] + i%2 #print(popcount) #dp[mask][j]:maskを使った時の余りがj dp = [[0]*(K) for _ in range(1<>i)&1 == 1: continue #既に含まれている val = A[i]*base%K for j in range(K): #print(mask|1<