1
2
3
4
5
6
7
|
n,m=map(int,input().split())
ki=list(map(int,input().split()))
tmp=[]
for i in ki:
for j in range(i,n+1):
if j%i ==0:tmp.append(j)
print(sum(set(tmp)))
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
[백준] 17206 (0) | 2021.01.18 |
---|---|
[백준] 17201 (0) | 2021.01.18 |
[백준] 16968 (0) | 2021.01.18 |
[백준] 16944 (0) | 2021.01.18 |
[백준] 16676 (0) | 2021.01.18 |
댓글