import math
def solution(n, stations, w):
answer, end = 0, 0
for s in stations:
answer += math.ceil(((s-w-1 if s-w>1 else 0)-end)/(2*w+1))
end = s+w if s+w<n else n
return answer + math.ceil((n-end)/(2*w+1))
굳이 기지국의 위치를 배열로 표현할 필요없는 문제