https://www.acmicpc.net/problem/10942 시간 0.5초, 메모리 256MB input : N (1 ≤ N ≤ 2,000) 칠판에 적은 수는 100,000보다 작거나 같은 자연수 M (1 ≤ M ≤ 1,000,000) S와 E가 한 줄에 하나