What should be the approach in this ques

https://codeforces.com/contest/1187/problem/C

Hi @hunt
refer to dis for more help.


if u r not able to understand anything in dis code, post ur doubt here.