Part of 2022 South Africa National Olympiad
Source: South African Mathematics Olympiad 2022, Problem 1