ALICE AND BOB 2 test case wrong

question = https://hack.codingblocks.com/contests/c/452/1013
solution = https://ide.codingblocks.com/#/s/21590

There was logical error with your code
You should use dp ,look at this code
https://ide.codingblocks.com/#/s/22247