Let's find \(gcd(|a|, |b|)\) and divide both numbers by it - this will be the answer.
c
d
a
b
gcd
1000 ms 256 Mb Rules for program design and list of errors in automatic problem checking