Part of 2018 Regional Competition For Advanced Students
Source: Austrian Mathematics Olympiad Regional Competition (Qualifying Round) 2018, Problem 1