Problem in mo-algorithm implementation

I tried to solve this question based on mo-algorithm but I couldn’t got AC.Here is my solution, can anyone tell what is the mistake in my solution.

I don’t have enough karma to ask a question. Guys help me please.

1 Like