Part of 2016 Federal Competition For Advanced Students, P2
Source: Austrian Math Olympiad 2016, final round, problem 6