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