use proconio::input; fn main() { input! { t:usize, n:[i64;t], } for n in n { let a = n * n + 2 * n + 2; let b = n * n - 2 * n + 2; let is_p = a == 1 || b == 1; let mut cnt = [[0, 0], [0, 0]]; for (i, mut x) in [a, b].into_iter().enumerate() { for (j, d) in [2, 5].into_iter().enumerate() { while x % d == 0 { x /= d; cnt[i][j] += 1; } } } let cnt2 = cnt[0][0] + cnt[1][0]; let cnt5 = cnt[0][1] + cnt[1][1]; let cnt10 = cnt2.min(cnt5); println!("{}", if is_p { "Yes" } else { "No" }); println!("{}", cnt10); } }