Bizarre test cases in LENTMO

So, I attempted LENTMO question from June Long Challenge
Here, is my solution,
https://www.codechef.com/viewsolution/24848132
I don’t get how i am missing first two subtasks :confused:
Can somebody explain what case i am missing?

Well I can tell you the test case in which you are failing .
6
5 1 22 20 5 7
5
6

output expected is 66

Your n-k==1 case is wrong.
it should be part of the n-k>=2 block.
https://www.codechef.com/viewsolution/24859214.
i made the changes here.
cheers!!

2 Likes

aah i see! thank you

Damn!
Ugh could have gotten those 20 marks XD such a stupid mistake!

thank you! :slight_smile:
I really didn’t realise this! :frowning: