Part of 2008 Singapore Senior Math Olympiad
Source: Singapore Senior Math Olympiad 2008 2nd Round p5 SMO