What is Wrong with this code..?

I was practicing and stumbled upon this question - SHIRO Problem - CodeChef

here I read the editorial and tried solving it the same way.
I have used the “table of 2 by K” as explained in the tutorial.
I dont understand why my answer is wrong. Can anyone explain please…

My Code - CodeChef: Practical coding for everyone