#include // assert #include // cin, cout, ios #include // swap #include #include #include namespace mp = boost::multiprecision; using bigint = mp::cpp_int; int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); boost::random::mt19937 gen; int n; std::cin >> n; for(int i = 0; i < n; i++) { unsigned long long x; std::cin >> x; int is_prime = (int)((x & 1) == 0 ? x == 2 : mp::miller_rabin_test(x, 20)); std::cout << x << ' ' << is_prime << '\n'; } }