-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path2DArrayDS.cpp
39 lines (31 loc) · 877 Bytes
/
2DArrayDS.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double ld;
// Kevin Mathew T
// Birla Institute of Technology, Mesra
// GitHub - https://github.com/KevinMathewT
// CodeForces - https://codeforces.com/profile/KevinMathew
// CodeChef - https://www.codechef.com/users/KevinMathew
// HackerRank - https://www.hackerrank.com/KevinMathew?
ll a[6][6];
void solve(){
for(ll i=0;i<6;i++)
for(ll j=0;j<6;j++)
cin >> a[i][j];
ll mx = LLONG_MIN;
for(ll i=0;i<4;i++)
for(ll j=0;j<4;j++)
mx = max(mx, a[i][j] + a[i][j+1] + a[i][j+2] + a[i+1][j+1] + a[i+2][j] + a[i+2][j+1] + a[i+2][j+2]);
cout << mx << "\n";
}
int main()
{
freopen("input.txt", "r", stdin); //Comment
freopen("output.txt", "w", stdout); //this out.
ios::sync_with_stdio(false); //Not
cin.tie(NULL); //this.
cout.tie(0); //or this.
solve();
return 0;
}