You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
455 B

#include<iostream>
using namespace std;
int main() {
int K;
cin >> K;
int count = 0;
for (int i = 10000; i <= 30000; i++) {
int sub1 = i / 100;
int sub2 = (i - i / 10000 * 10000) / 10;
int sub3 = i % 1000;
if (sub1 % K == 0 && sub2 % K == 0 && sub3 % K == 0) {
cout << i << endl;
count++;
}
}
if (count == 0) {
cout << "No" << endl;
}
return 0;
}