Part of 2019 Czech and Slovak Olympiad III A
Source: Czech and Slovak Olympiad 2019, National Round, Problem 5