Skip to content

Instantly share code, notes, and snippets.

@icub3d
Created December 21, 2025 20:48
Show Gist options
  • Select an option

  • Save icub3d/dc303e9ff0700b75ec5f71551d4872e0 to your computer and use it in GitHub Desktop.

Select an option

Save icub3d/dc303e9ff0700b75ec5f71551d4872e0 to your computer and use it in GitHub Desktop.
Kattis thanos
use std::io::{Read, stdin};
fn main() {
let mut s = String::new();
stdin().read_to_string(&mut s).unwrap();
for m in s.lines().skip(1) {
let vv = m
.split_whitespace()
.map(|v| v.parse::<f64>().unwrap())
.collect::<Vec<_>>();
let (mut p, r, s) = (vv[0], vv[1], vv[2]);
let mut year = 0;
while p <= s {
p = (p * r).floor();
year += 1;
}
println!("{year}");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment