Arranging Cup-cakes

qstn: RESQ Problem - CodeChef

sotn: CodeChef: Practical coding for everyone

can any point where my approach is going wrong

here is my approach

let the dimension of cake be one_half(length),other_half(width)

let initially cake one_half is 1(i.e length is 1) and other_half(width)=n(full size)

then decrease other_half(width) till it become equal or greater to one_half(length)

answer=mod(other_half-one half)