The problem can be solved using brute force and BIT as well.
I tried to solve it using segment tree with point updates, but getting WA.
Can anyone help or maybe give a test case where it fails?
Here’s my code (
) Here's the [Problem Link] Thanks! : https://www.codechef.com/viewsolution/14397442 : https://www.codechef.com/problems/MARBLEGF/