fn input_num() -> usize { let mut line: String = String::new(); std::io::stdin().read_line(&mut line).unwrap(); line.trim().parse().unwrap() } fn input_chars() -> Vec { let mut line: String = String::new(); std::io::stdin().read_line(&mut line).unwrap(); line.trim().chars().collect() } fn input_nums() -> (usize, f64, f64) { let mut line: String = String::new(); std::io::stdin().read_line(&mut line).unwrap(); let mut iter = line.split_whitespace(); ( iter.next().unwrap().parse().unwrap(), iter.next().unwrap().parse().unwrap(), iter.next().unwrap().parse().unwrap() ) } fn input_vec_nums() -> Vec { let mut line: String = String::new(); std::io::stdin().read_line(&mut line).unwrap(); line.split_whitespace() .map(|x| x.parse().unwrap()) .collect() } fn main() { let (mut l, s, d) = input_nums(); let mut t = d / s; let mut ans = 0.0; while t > 0.0 { if t >= 1.0 { t -= 1.0; l += 1; if l % 24 <= 6 || l % 24 >= 19 { ans += 1.0; } } else { l += 1; if l % 24 <= 6 || l % 24 >= 18 { ans += t; } t = 0.0; } } println!("{}", ans); }