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