#P1151. 子数整数

子数整数

Description

For a five-digit number a1a2a3a4a5\overline{a_1a_2a_3a_4a_5}, it can be split into three subnumbers:

sub1=a1a2a3sub_1=\overline{a_1a_2a_3}

sub2=a2a3a4sub_2=\overline{a_2a_3a_4}

sub3=a3a4a5sub_3=\overline{a_3a_4a_5}

For example, the five-digit number 2020720207 can be split into

sub1=202sub_1=202

sub2=020 (=20)sub_2=020\ (=20)

sub3=207sub_3=207

Given a positive integer KK, write a program to find all five-digit numbers between 1000010000 and 3000030000 inclusive such that their three subnumbers sub1,sub2,sub3sub_1, sub_2, sub_3 are all divisible by KK.

Input Format

A positive integer KK.

Output Format

Output one qualifying five-digit number per line in increasing order. Do not output duplicates or miss any. If there is no solution, output No.

15
22555
25555
28555
30000

Hint

0<K<10000<K<1000

Translated by ChatGPT 5