import java.util.*;
import java.lang.*;
import java.io.*;
class Main
{
private static long gcd(long a, long b) {
long p = a % b;
if (p == 0L) {
return b;
} else {
return gcd(b, p);
}
}
private static void test(final int N) {
long[] list = new long[N];
for (int i = 0; i < N; ++i) {
list[i] = (long)(i + 1);
}
for (int i = 1; i < N; ++i) {
for (int j =i + 1; j < N; ++j) {
long x = Main.gcd(list[i], list[j]);
long y = (list[i] * list[j]) / x;
list[i] = x;
list[j] = y;
}
}
System.
out.
println("N = " + N
); for (int i= 0; i < N; ++i) {
System.
out.
print(list
[i
] + " "); }
}
{
Main.test(6);
Main.test(20);
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBNYWluCnsKCXByaXZhdGUgc3RhdGljIGxvbmcgZ2NkKGxvbmcgYSwgbG9uZyBiKSB7CgkJbG9uZyBwID0gYSAlIGI7CgkJaWYgKHAgPT0gMEwpIHsKCQkJcmV0dXJuIGI7CgkJfSBlbHNlIHsKCQkJcmV0dXJuIGdjZChiLCBwKTsKCQl9Cgl9CgkKCXByaXZhdGUgc3RhdGljIHZvaWQgdGVzdChmaW5hbCBpbnQgTikgewoJCWxvbmdbXSBsaXN0ID0gbmV3IGxvbmdbTl07CgkJCgkJZm9yIChpbnQgaSA9IDA7IGkgPCBOOyArK2kpIHsKCQkJbGlzdFtpXSA9IChsb25nKShpICsgMSk7CgkJfQoJCQoJCWZvciAoaW50IGkgPSAxOyBpIDwgTjsgKytpKSB7CgkJCWZvciAoaW50IGogPWkgKyAxOyBqIDwgTjsgKytqKSB7CgkJCQlsb25nIHggPSBNYWluLmdjZChsaXN0W2ldLCBsaXN0W2pdKTsKCQkJCWxvbmcgeSA9IChsaXN0W2ldICogbGlzdFtqXSkgLyB4OwoJCQkJbGlzdFtpXSA9IHg7CgkJCQlsaXN0W2pdID0geTsKCQkJfQoJCX0KCQkKCQlTeXN0ZW0ub3V0LnByaW50bG4oIk4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