Can anyone tell me what is wrong in my solution for this DP problem

Problem:- Practice Problem

This is my submission:- Hackerearth problem -Prime Numbers again - Pastebin.com