solutions: 451A
This commit is contained in:
parent
99cdfebdd9
commit
f54b8da2f2
1 changed files with 28 additions and 0 deletions
28
solutions/rust/src/bin/451A.rs
Normal file
28
solutions/rust/src/bin/451A.rs
Normal file
|
@ -0,0 +1,28 @@
|
|||
use std::io;
|
||||
|
||||
fn main() {
|
||||
let mut s = String::new();
|
||||
io::stdin().read_line(&mut s).unwrap();
|
||||
|
||||
let a = s.trim().split_whitespace().map(|i| i.parse::<i64>().unwrap()).collect::<Vec<i64>>();
|
||||
let mut n = a[0];
|
||||
let mut m = a[1];
|
||||
|
||||
let mut intersections = n*m;
|
||||
|
||||
let mut steps = 0;
|
||||
|
||||
while intersections > 0 {
|
||||
intersections -= (n+m)-1;
|
||||
n -= 1;
|
||||
m -= 1;
|
||||
|
||||
steps += 1;
|
||||
}
|
||||
|
||||
if (steps+1) % 2 == 0 {
|
||||
println!("Akshat");
|
||||
} else {
|
||||
println!("Malvika");
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue