Part of 2022 Pan-American Girls' Math Olympiad
Source: Pan-American Girls’ Mathematical Olympiad 2022, Problem 3