Codeforces round 425 Problem B

codeforces
problem

#1

Can any help me With the question
Problem Link


#2

This is just an implementation problem. The editorial is given, right?