-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathA_Cherry.cpp
75 lines (59 loc) · 1.31 KB
/
A_Cherry.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/**
* Bismillahir Rahmanir Rahim
* Author: Ashfak Hossain Evan, American International University, Bangladesh
* Created: 03/09/2023 21:35:15
**/
#include <bits/stdc++.h>
#ifdef LOCAL
#include "algo/debug.h"
#else
#define debug(...) 42
#endif
#define all(x) (x).begin(), (x).end()
#define sz(x) int(x.size())
#define char2Int(c) (c - '0')
#define lastEle(vec) vec[vec.size() - 1]
#define PI 3.1415926535897932384626433832795l
#define endl '\n'
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vi> vvi;
typedef map<int, int> mpii;
typedef set<int> seti;
typedef multiset<int> mseti;
const int MAX_N = 1e5 + 5;
const ll MOD = 1e9 + 7;
const ll INF = 1e9;
const ld EPS = 1e-9;
void solve()
{
int n;
cin >> n;
vi v(n);
for (auto &x : v)
cin >> x;
ll ans(0);
for (int i = 1; i < n; ++i)
ans = max(ans, 1LL * v[i] * v[i - 1]);
cout << ans << endl;
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
#ifdef LOCAL
freopen("input.txt", "r", stdin);
freopen("error.txt", "w", stderr);
freopen("output.txt", "w", stdout);
#endif
int _;
cin >> _;
while (_--)
solve();
return 0;
}