#include #include #include static std::mt19937 mt(0); using Entry = std::pair; auto gen_random_ans(int n) { constexpr int m = 50; std::vector ans; for (int i = 0; i < m; i++) { int u, v; while (true) { u = mt() % n; v = mt() % n; if (u != v) { break; } } ans.emplace_back(u,v); } return ans; } void print_ans(const std::vector& ans) { std::cout << ans.size() << std::endl; for (auto [u,v] : ans) { std::cout << u << " " << v << std::endl; } } int main() { int n; std::cin >> n; std::vector a(n), b(n); for (int i = 0; i < n; i++) { std::cin >> a[i] >> b[i]; } auto ans = gen_random_ans(n); print_ans(ans); }