Part of 2004 Federal Competition For Advanced Students, Part 1
Source: Austrian Mathematical Olympiad 2004, Part 1, P4