macro_rules! read_line_to_tuple { ( $( $t:ty ),* ) => {{ let mut input = String::new(); std::io::stdin().read_line(&mut input).unwrap(); let mut iter = input.split_whitespace(); ( $( iter.next().unwrap().parse::<$t>().unwrap() ),* ) }}; } fn solve() -> String { let p = read_line_to_tuple!(usize); if p == 2 { String::from("2") } else { ((p - 1) * (p - 1)).to_string() } } fn main() { let n = read_line_to_tuple!(usize); let mut ans = Vec::with_capacity(n); for _ in 0..n { ans.push(solve()); } println!("{}", ans.join("\n")); }