Atcoder ABC 042 Problem D
Guys, can someone explain me the solution of this problem? I couldn't understand fully.
Problem D