Part of 2001 Finnish National High School Mathematics Competition
Source: Finnish Mathematics Competition 2001, Final Round, Problem 5