Interesting Problem from ECPC qualifications day 2

Revision en2, by Chess.Master, 2023-08-12 21:04:19

Hello codeforeces, I was trying to upsolve the ECPC Q day 2 and I am stuggle with this problem and need some help please.

image

I am thinking of using mo's algorithm but I can't solve this problem. Can any one help me please?

Tags ecpc, icpc, acpc, help, upsolve

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Chess.Master 2023-08-12 21:04:19 12
en1 English Chess.Master 2023-08-12 20:37:11 377 Initial revision (published)