Advertisement
fahimkamal63

Problem J

Sep 28th, 2019
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstdio>
  3. using namespace std;
  4.  
  5. int main(){
  6.     int t; cin >> t;
  7.     for(int i = 1; i <= t; i++){
  8.         int k; cin >> k;
  9.         unsigned long long int a[k];
  10.         for(int j = 0; j < k; j++){
  11.             cin >> a[j];
  12.         }
  13.         unsigned long long int result = 1;
  14.         if(k == 1){
  15.             result = a[0] * a[0];
  16.         }
  17.         else{
  18.             result = a[0] * a[k-1];
  19.         }
  20.         cout << "Case " << i << ": " << result;
  21.         //printf("Case %d: %lld", i, result);
  22.         if(i != t) cout << endl;
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement