solutions: 1327A
This commit is contained in:
parent
8d3457b028
commit
08a50a8d87
1 changed files with 24 additions and 0 deletions
24
solutions/rust/src/bin/1327A.rs
Normal file
24
solutions/rust/src/bin/1327A.rs
Normal file
|
@ -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<u64> = s.split_whitespace().map(|d| d.parse::<u64>().unwrap()).collect();
|
||||
|
||||
if a[0] % 2 == a[1] % 2 {
|
||||
if a[1].pow(2) > a[0] {
|
||||
println!("NO");
|
||||
} else {
|
||||
println!("YES");
|
||||
}
|
||||
} else {
|
||||
println!("NO");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue