Please guys help me to solve this problem . I added code snippet below but it's not resolve problem statement . It may misunderstood for us but would you please guide where I am doing wrong ? Thanks
int main()
{
int rc,k;
std::cin>>rc;
std::cin>>k;
int matrix[rc][rc];
for(int i=0;i<rc;i++){
for(int j=0;j<rc;j++){
std::cin>>matrix[i][j];
}
}
int sum=0;
int mul=1;
for(int i=2;i<k;i++){
for(int j=1;j<i;j++){
if(matrix[i][j]!=0)
mul*=matrix[i][j];
}
sum+=mul;
}
std::cout<<sum<<" "<<mul;
}