Sample input correct but not being accepted

code: https://ide.codingblocks.com/s/489047

Your Mistakes

  1. initialize dp array in every testcase
    otherwise previous testcase ans mix with next one

  2. use long long int instead of int

Modified Code