시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 160 52 39 35.455%

문제

특정 숫자로 이루어진 X의 배수 중에서 A보다 크거나 같고, B보다 작거나 같은것의 개수를 구하는 프로그램을 작성하시오.

입력

첫째 줄에 X, A, B가 주어진다. (1 ≤ X ≤ 1011, 1 ≤ A ≤ B ≤ 1011)

둘째 줄에는 사용할 수 있는 숫자가 오름차순으로 중복없이 주어진다.

출력

첫째 줄에 A보다 크거나 같고 B보다 작거나 같은 X의 배수 중에서, 입력으로 주어진 숫자로만 이루어진 것의 개수를 출력한다.

예제 입력 1

6 100 9294
23689

예제 출력 1

111
W3sicHJvYmxlbV9pZCI6IjMwMjYiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJWIiwiZGVzY3JpcHRpb24iOiI8cD5cdWQyYjlcdWM4MTUgXHVjMjJiXHVjNzkwXHViODVjIFx1Yzc3NFx1YjhlOFx1YzViNFx1YzljNCBYXHVjNzU4IFx1YmMzMFx1YzIxOCBcdWM5MTFcdWM1ZDBcdWMxMWMgQVx1YmNmNFx1YjJlNCBcdWQwNmNcdWFjNzBcdWIwOTggXHVhYzE5XHVhY2UwLCBCXHViY2Y0XHViMmU0IFx1Yzc5MVx1YWM3MFx1YjA5OCBcdWFjMTlcdWM3NDBcdWFjODNcdWM3NTggXHVhYzFjXHVjMjE4XHViOTdjIFx1YWQ2Y1x1ZDU1OFx1YjI5NCBcdWQ1MDRcdWI4NWNcdWFkZjhcdWI3YThcdWM3NDQgXHVjNzkxXHVjMTMxXHVkNTU4XHVjMmRjXHVjNjI0LjxcL3A+XHJcbiIsImlucHV0IjoiPHA+XHVjY2FiXHVjOWY4IFx1YzkwNFx1YzVkMCBYLCBBLCBCXHVhYzAwIFx1YzhmY1x1YzViNFx1YzljNFx1YjJlNC4gKDEgJmxlOyBYICZsZTsgMTA8c3VwPjExPFwvc3VwPiwgMSAmbGU7IEEgJmxlOyBCICZsZTsgMTA8c3VwPjExPFwvc3VwP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