Part of 1987 National High School Mathematics League
Source: 1987 National High School Mathematics League, Exam One, Problem 9