Part of 1999 National High School Mathematics League
Source: 1999 National High School Mathematics League, Exam One, Problem 5