Firstly, apologies since I honestly don't know how to type latex. Anyways, most of us probably took part in the most recent Div(1+2) round, and E was kinda a bloodbath.
I read the editorial solution, and it seemed that many people used some form of fenwick to solve it. I'm trying to use fft however.
The only difficulty now would be finding the coefficients for a fixed k. I could do so when at least one number <= k was present in the array. However it seems like I'm not so sure how it'd go if none were present.
My current idea is that you have to iterate over >=k -1's. However that seems inefficient. Anyone could suggest a hint for me? Thanks.
I included my implementation here. The case I would need to complete is around line 150.




