0_0_36863938_29899.cpp: In function 'int main()': 0_0_36863938_29899.cpp:70:43: error: 'j' was not declared in this scope for(int k=0;k<=p;k++) ans=max(ans,dp[n][j][k]); ^