#![allow(unused_imports)] #![allow(unused_macros)] #![allow(non_snake_case)] use proconio::marker::{Bytes, Chars, Isize1, Usize1}; use proconio::{fastout, input, input_interactive}; #[fastout] fn main() { input! { T: usize, } for _ in 0..T { input! { N: usize, } let cnt = calc_divisor_count(N); if cnt & 1 == 0 { println!("K"); } else { println!("P"); } } } fn calc_divisor_count(n: usize) -> usize { let mut count = 0; for i in 1..=n { if n % i == 0 { count += 1; } } count } #[macro_export] macro_rules! mat { ($($e:expr),*) => { vec![$($e),*] }; ($($e:expr,)*) => { vec![$($e),*] }; ($e:expr; $d:expr) => { vec![$e; $d] }; ($e:expr; $d:expr $(; $ds:expr)+) => { vec![mat![$e $(; $ds)*]; $d] }; } #[macro_export] macro_rules! chmin { ($a:expr, $b:expr) => { if $a > $b { $a = $b; true } else { false } }; } #[macro_export] macro_rules! chmax { ($a:expr, $b:expr) => { if $a < $b { $a = $b; true } else { false } }; } /// https://maguro.dev/debug-macro/ #[macro_export] macro_rules! debug { ($($a:expr),* $(,)*) => { #[cfg(debug_assertions)] eprintln!(concat!($("| ", stringify!($a), "={:?} "),*, "|"), $(&$a),*); }; }