Part of 2002 Finnish National High School Mathematics Competition
Source: Finnish Mathematics Competition 2002, Final Round, Problem 3