MathDB

Problem 2

Part of 2017 Pakistan TST