diff --git a/solutions/rust/src/bin/1327A.rs b/solutions/rust/src/bin/1327A.rs new file mode 100644 index 0000000..603c609 --- /dev/null +++ b/solutions/rust/src/bin/1327A.rs @@ -0,0 +1,24 @@ +use std::io; + +fn main() { + let mut s = String::new(); + io::stdin().read_line(&mut s).unwrap(); + let t: u64 = s.trim().parse().unwrap(); + + for _ in 0..t { + let mut s = String::new(); + io::stdin().read_line(&mut s).unwrap(); + + let a: Vec = s.split_whitespace().map(|d| d.parse::().unwrap()).collect(); + + if a[0] % 2 == a[1] % 2 { + if a[1].pow(2) > a[0] { + println!("NO"); + } else { + println!("YES"); + } + } else { + println!("NO"); + } + } +}