Pagini recente » Cod sursa (job #3176584) | Cod sursa (job #83875) | Cod sursa (job #1583655) | Cod sursa (job #1602849) | Cod sursa (job #2764306)
#include <bits/stdc++.h>
using namespace std;
ifstream f("plantatie.in");
ofstream g("plantatie.out");
int main()
{
long long n, m, d[501][501];
f >> n >> m;
for(int i = 1; i<= n; i++){
for(int j = 1; j<= n; j++){
f >> d[i][j];
}
}
for(int k = 1; k<= m; k++){
long long maxNr = 0, a,b ,c;
f >> a >> b >> c;
for(int i = a; i<= a + c - 1; i++){
for(int j = b; j <= b+c -1; j++){
maxNr = max(maxNr, d[i][j]);
}
}
g << maxNr << "\n";
}
}