Skip to content

Commit 3664316

Browse files
committed
29 Dec 2022
1 parent 3727b62 commit 3664316

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed
+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#include <bits/stdc++.h>
2+
using namespace std;
3+
#define FIO \
4+
ios_base::sync_with_stdio(0); \
5+
cin.tie(0); \
6+
cout.tie(0);
7+
8+
#define nl '\n'
9+
#define INF 0x3F3F3F3F
10+
int main()
11+
{
12+
FIO;
13+
int t;
14+
cin >> t;
15+
while (t--)
16+
{
17+
18+
int a, b;
19+
cin >> a >> b;
20+
long long v[a + 1][b + 1];
21+
int x = 0, y = 0;
22+
long long now = -INF;
23+
for (int i = 0; i < a; i++)
24+
{
25+
for (int j = 0; j < b; j++)
26+
{
27+
cin >> v[i][j];
28+
if (v[i][j] > now)
29+
{
30+
now = v[i][j];
31+
x = i + 1;
32+
y = j + 1;
33+
}
34+
}
35+
}
36+
37+
int xx = abs(1 - x) + 1;
38+
int yy = abs(1 - y) + 1;
39+
40+
int xxx = abs(1 - x) + 1;
41+
int yyy = abs(b - y) + 1;
42+
43+
int xxxx = abs(a - x) + 1;
44+
int yyyy = abs(1 - y) + 1;
45+
46+
int xxxxx = abs(a - x) + 1;
47+
int yyyyy = abs(b - y) + 1;
48+
49+
int f = xx * yy;
50+
int s = xxx * yyy;
51+
int th = xxxx * yyyy;
52+
int ls = xxxxx * yyyyy;
53+
54+
cout << max({f, s, th, ls}) << nl;
55+
}
56+
}

0 commit comments

Comments
 (0)