Hey! Recently, I have tried 1500B - Two chandeliers and after few hours I gave up and opened the editorial. The problem is, I don't quite understand author's solution. I have 3 questions about it.
Why in the second congruence, there is $$$y$$$ instead of $$$x$$$?
What is the point of finding the number of solutions to that pair of congruences? How does it correlate with number of $$$a_i \neq b_i$$$ in prefix of size $$$x$$$?
- The problem states that all $$$a_i$$$ are different (same goes for all $$$b_i$$$). Why does it matter?
Thanks in advance!