Part of 2015 Czech and Slovak Olympiad III A
Source: Czech and Slovak Olympiad 2015, National Round, Problem 4