Created
January 12, 2026 19:58
-
-
Save icub3d/4c319c7f8b74a3a00cbb4ec065519a10 to your computer and use it in GitHub Desktop.
Kattis mosquito
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::io::{Read, stdin}; | |
| fn main() { | |
| let mut s = String::new(); | |
| stdin().read_to_string(&mut s).unwrap(); | |
| // $M$ , $P$ , $L$ , $E$ , $R$ , $S$ , $N$ | |
| for m in s.lines() { | |
| let mut pp = m.split_whitespace().map(|l| l.parse::<usize>().unwrap()); | |
| let (mut m, mut p, mut l, e, r, s, n) = ( | |
| pp.next().unwrap(), | |
| pp.next().unwrap(), | |
| pp.next().unwrap(), | |
| pp.next().unwrap(), | |
| pp.next().unwrap(), | |
| pp.next().unwrap(), | |
| pp.next().unwrap(), | |
| ); | |
| for _ in 0..n { | |
| let nl = m * e; | |
| let np = l / r; | |
| let na = p / s; | |
| l = nl; | |
| p = np; | |
| m = na; | |
| } | |
| println!("{}", m); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment