macro_rules! read_line_to_tuple { ( $( $t:ty ),* ) => {{ let mut input = String::new(); std::io::stdin().read_line(&mut input).unwrap(); let mut iter = input.split_whitespace(); ( $( iter.next().unwrap().parse::<$t>().unwrap() ),* ) }}; } fn main() { let (a, b) = read_line_to_tuple!(i32, i32); let long_hand = a * 60 + b; let short_hand = b * 12; let mut diff = (long_hand - short_hand) % 720; if diff < 0 { diff += 720; } let ans = diff * 60 / 11; println!("{}", ans); }