Pashmak and parmida problem

I did not understand the video. Can you please help me out?

Hey @himanshugupta8
Check this https://www.quora.com/How-do-I-solve-459D-Pashmak-and-Parmidas-Problem-on-Codeforces 3

Let me know if u need any help