Ad hoc, read problem carefully
Math, gcd