The link to the code is given below:
http://www.codechef.com/viewsolution/5525391
Thank you!
Always try giving ideone link of the code. However, try this:
1
1 2
0
Answer should be no.
Hey @amritkrs
Check these cases:
1 2 0 no 10 2 4 5 1 5 5 0 5 1 4 8 yes
Your code fails on these cases…
Hey @damn_me
btw as far i know K cannot be 0…
so this is not a valid test case as…
Constraints 1 ≤ T ≤ 10 1 ≤ N ≤ 21 1 ≤ K ≤ 8