Plabon_dutta

Codeforces Round #735 (Div. 2), problem: (A) Cherry

Jul 29th, 2021
1,507
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. #define pi acos(-1.0)
  6. #define ll long long int
  7. #define sc scanf
  8. #define pf printf
  9. #define fin for(ll i=0; i<n; i++)
  10. #define fjm for(ll j=0; j<m; j++)
  11. #define fr(i,a,n) for(ll i=a; i<n; i++)
  12. #define rf(i,n,a) for(ll i=n-1; i>=a; i--)
  13. #define nl "\n"
  14. #define readfirst() (ios_base:: sync_with_stdio(false),cin.tie(NULL));
  15.  
  16. ll gcd(ll p, ll q) {
  17.     return q==0?p:gcd(q,p%q);
  18. }
  19.  
  20. int main() {
  21.     readfirst();
  22.     ll t, n, k;
  23.     cin >> t;
  24.     while(t--) {
  25.         cin >> n;
  26.         ll a[n+2];
  27.         fin cin >> a[i];
  28.         k=0;
  29.         fr(i,0,n-1) k=max(k,a[i]*a[i+1]);
  30.         cout << k << nl;
  31.     }
  32.     return 0;
  33. }
RAW Paste Data