Part of 2008 Finnish National High School Mathematics Competition
Source: Finnish Mathematics Competition 2008, Final Round, Problem 2