SPOJ CLASSICAL ACPC10A
UVA IRREDUCIBLE BASIC FRACTIONS. TLE