Part of 2018 Federal Competition For Advanced Students, P1
Source: Austrian Mathematical Olympiad 2018