-Code
w, p = map(int, input().split())
res = []
partition = [0] + list(map(int, input().split())) + [w]
for i in range(len(partition) - 1):
for j in range(i + 1, len(partition)):
res.append(partition[j] - partition[i])
print(*sorted(set(res)))
'Beakjoon&프로그래머스 > 파이썬' 카테고리의 다른 글
[백준/파이썬] 27880번 Gahui and Soongsil University station (0) | 2023.05.22 |
---|---|
[백준/파이썬] 15122번 Forbidden Zero (0) | 2023.05.21 |
[백준/파이썬] 25576번 찾았다 악질 (1) | 2023.05.19 |
[백준/파이썬] 11531번 ACM 대회 채점 (0) | 2023.05.18 |
[백준/파이썬] 10540번 KLOPKA (0) | 2023.05.17 |