1
0
Fork 0
This repository has been archived on 2023-05-11. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
lesson-codeforces-rust/50A.rs
2023-03-27 07:33:31 +04:00

26 lines
662 B
Rust

use std::io::{self, Read, Write};
fn main() {
let mut stdin = io::stdin();
let mut stdout = io::stdout();
let mut input = String::new();
stdin.read_to_string(&mut input).unwrap();
let mut inputs = input.split_whitespace();
let input1 = inputs.next().unwrap();
let input2 = inputs.next().unwrap();
let width = input1.parse::<i32>().unwrap();
let height: i32 = input2.parse().unwrap();
let result =
if width % 2 == 0 || height % 2 == 0 {
width * height / 2
}
else {
(width * height - 1) / 2
};
stdout.write_all(format!("{}\n", result).as_ref()).unwrap();
}