0_0_36863937_799.cpp: In function 'int main()': 0_0_36863937_799.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]); ^