Art of Problem Solving

2017 USAMO Problems/Problem 2