fn solve(target_primes: &Vec) -> usize { let mut x = String::new(); std::io::stdin().read_line(&mut x).ok(); let x: usize = x.trim().parse().unwrap(); let n = target_primes.len(); let mut cnts = vec![0usize; n]; for i in 0..n { let mut target = x; while target % target_primes[i] == 0 { target /= target_primes[i]; cnts[i] += 1; } } (0..n).map(|i| target_primes[i].pow(cnts[i] as u32 + 1)).min().unwrap() * x } fn main() { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let n: usize = n.trim().parse().unwrap(); let mut result = Vec::with_capacity(n); let target_primes = vec![2,3,5,7,11,13,17,19,23,29,31,37]; for _ in 0..n { result.push(solve(&target_primes)); } for &v in result.iter() { println!("{}", v); } }