#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
LL a[1010][1010],b[1010][1010];
LL n,m,c;
LL x2,y2;
LL ans=-1e20;
int main()
{
cin>>n>>m>>c;
for(int i=1;i<=n;i++)
for(int j=1;j<=m;j++)
{
cin>>a[i][j];
b[i][j]=a[i][j]+b[i-1][j]+b[i][j-1]-b[i-1][j-1];
}
for(int x1=1;x1<=n-c;x1++){
for(int y1=1;y1<=m-c;y1++){
if(b[x1+c-1][y1+c-1]+b[x1-1][y1-1]-b[x1+c-1][y1-1]-b[x1-1][y1+c-1]>ans){
ans=b[x1+c-1][y1+c-1]+b[x1-1][y1-1]-b[x1+c-1][y1-1]-b[x1-1][y1+c-1];
x2=x1,y2=y1;
}
}
}
cout<<x2<<" "<<y2;
}
数组也开大了,也有long long 不知道哪错了 是ra不是超时