WA in Greedy Puppy

Hi! Please help me out on this one! My logic is simple if K < N / 2, check for each and every value till one and find maximum! I couldn’t find any wrong test case!
Bad test case and any advice for logic improvement will be highly appreciated! Thank you!

link to question
link to solution