You are on page 1of 1

#include <iostream>

using namespace std;

int main()
{
int n, k, s=0;
cin>>n;
cin>>k;
int m[n][n];
for (int i=0; i<n; i++)
{
for (int j=0; j<n; j++)
{
cin>>m[i][j];
}
}
for (int l=0; l<k; l++)
{
s=s+m[k-1-l][l];
}
cout<<s;

return 0;
}

You might also like