MMO 2015 Problem 4

MMO 2015 PROBLEM 3

Solution