Skip to content

Instantly share code, notes, and snippets.

@whatalnk
Created July 28, 2017 08:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whatalnk/4ad2fe9edf2887a85a07ffec932a9811 to your computer and use it in GitHub Desktop.
Save whatalnk/4ad2fe9edf2887a85a07ffec932a9811 to your computer and use it in GitHub Desktop.
AtCoder ABC #067 [Rust]
use std::io;
use std::str::FromStr;
fn main() {
let stdin = io::stdin();
let mut buf = String::new();
stdin.read_line(&mut buf).ok();
let mut it = buf.split_whitespace()
.map(|n| i64::from_str(n).unwrap());
let (a, b) = (it.next().unwrap(), it.next().unwrap());
if a % 3 == 0 || b % 3 == 0 || (a + b) % 3 == 0 {
println!("Possible");
} else {
println!("Impossible");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment