Part of 2004 South East Mathematical Olympiad
Source: China south east mathematical olympiad 2004 day1 problem 2