use std::io; use std::str::FromStr; use std::cmp::{ min, max }; use std::collections::{ BinaryHeap, VecDeque }; fn gcd(a:i32,b:i32) -> i32 { if b == 0 { a } else { gcd(b, a%b) } } fn main() { let mut sc = Scanner::new(); let a: i32 = sc.cin(); let b: i32 = sc.cin(); let c: i32 = sc.cin(); let k = { let m = a / gcd(a,b) * b; m / gcd(m,c) * c }; let mut v = vec![k/a,k/b,k/c]; v.sort(); // println!("{:?}",v); let n = gcd(v[2]-v[1], v[1]-v[0]); println!("{}/{}", k, n); } #[allow(dead_code)] struct Scanner { stdin: io::Stdin, buffer: VecDeque, } #[allow(dead_code)] impl Scanner { fn new() -> Scanner { Scanner { stdin: io::stdin(), buffer: VecDeque::new() } } fn reserve(&mut self) { while self.buffer.len() == 0 { let mut line = String::new(); let _ = self.stdin.read_line(&mut line); for w in line.split_whitespace() { self.buffer.push_back(String::from(w)); } } } fn cin(&mut self) -> T { self.reserve(); match self.buffer.pop_front().unwrap().parse::() { Ok(a) => a, Err(_) => panic!("parse err") } } fn get_char(&mut self) -> char { self.reserve(); let head = self.buffer[0].chars().nth(0).unwrap(); let tail = String::from( &self.buffer[0][1..] ); if tail.len()>0 { self.buffer[0]=tail } else { self.buffer.pop_front(); } head } }