시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 256 MB 1590 447 385 27.638%

문제

두 양의 정수가 주어졌을 때, 두 수 사이에 있는 정수를 모두 출력하는 프로그램을 작성하시오.

입력

두 정수 A와 B가 주어진다. (1 ≤ A, B ≤ 1015, A와 B의 차이는 최대 100,000)

출력

첫째 줄에 두 수 사이에 있는 수의 개수를 출력한다.

둘째 줄에는 두 수 사이에 있는 수를 오름차순으로 출력한다.

예제 입력 1

8 14

예제 출력 1

5
9 10 11 12 13

힌트

W3sicHJvYmxlbV9pZCI6IjEwMDkzIiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiXHVjMjJiXHVjNzkwIiwiZGVzY3JpcHRpb24iOiI8cD5cdWI0NTAgXHVjNTkxXHVjNzU4IFx1YzgxNVx1YzIxOFx1YWMwMCBcdWM4ZmNcdWM1YjRcdWM4NGNcdWM3NDQgXHViNTRjLCBcdWI0NTAgXHVjMjE4IFx1YzBhY1x1Yzc3NFx1YzVkMCBcdWM3ODhcdWIyOTQgXHVjODE1XHVjMjE4XHViOTdjIFx1YmFhOFx1YjQ1MCBcdWNkOWNcdWI4MjVcdWQ1NThcdWIyOTQgXHVkNTA0XHViODVjXHVhZGY4XHViN2E4XHVjNzQ0IFx1Yzc5MVx1YzEzMVx1ZDU1OFx1YzJkY1x1YzYyNC48XC9wPlxyXG4iLCJpbnB1dCI6IjxwPlx1YjQ1MCBcdWM4MTVcdWMyMTggQVx1YzY0MCBCXHVhYzAwIFx1YzhmY1x1YzViNFx1YzljNFx1YjJlNC4gKDEgJmxlOyBBLCBCICZsZTsgMTA8c3VwPjE1PFwvc3VwPiwgQVx1YzY0MCBCXHVjNzU4IFx1Y2MyOFx1Yzc3NFx1YjI5NCBcdWNkNWNcdWIzMDAgMTAwLDAwMCk8XC9wPlxyXG4iLCJvdXRwdXQiOiI8cD5cdWNjYWJcdWM5ZjggXHVjOTA0XHVjNWQwIFx1YjQ1MCBcdWMyMTggXHVjMGFjXH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