/* * validator */ #include std::pair read() { long long x = 0; char c; while (true) { c = std::getchar(); if (!std::isdigit(c)) { return std::pair(x, c); } x = 10 * x + c - '0'; } } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); std::cout << std::setprecision(15) << std::fixed; char c; long long N; int n; std::tie(N, c) = read(); std::tie(n, c) = read(); assert(std::getchar()==EOF); std::vector pinv(n), ckd(n); std::vector fact(n, 1); for (int i=1; i