Amazing! Can you show me your solution? And what do you mean by "test cases with shuffled size of l-r"? Do you have an example cause I've tried a lot (I tested it for nearly 100 times with different k and l-r sizes) and it still runs pretty fast?

Sorry for my mistake, I've just edited the statement.

Anyone has an answer yet?


Sadly, C2, D, E still too hard for me :((