Solution of 2019 MTAP Elimination Round/GRADE 5 - Question #19