Help Me! in this code!

Can anyone pls tell me whats wrong in my code…
it shows wrong answer but i have also checked the edge cases…

https://www.codechef.com/viewsolution/33590429

You have declared K as int. In the edge case
1
100 15 5 5

K will be go of bounds.