SRM 567 div2 p3 solved