Problem 3 :

Codeforces Round #744 (Div. 3) problem 3