Skip to content

Instantly share code, notes, and snippets.

@icub3d
Created January 20, 2026 16:17
Show Gist options
  • Select an option

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

Select an option

Save icub3d/c510fd9c646c2f8b71473b0b04e0f8fc to your computer and use it in GitHub Desktop.
Kattis bossbattle
use std::io::{Read, stdin};
fn main() {
let mut s = String::new();
stdin().read_to_string(&mut s).unwrap();
let n = s.trim().parse::<i32>().unwrap();
// <= 3 == 1
println!("{}", (n - 2).max(1));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment