#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int n, s, min = 1e9, max = 0;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d", &s);
if (max < s) max = s;
if (min > s) min = s;
}
printf("%d", min*max);
return 0;
}
'Language > C++' 카테고리의 다른 글
[C++ / 백준 1934] 최소공배수 (0) | 2021.08.20 |
---|---|
[C++ / 백준 2609] 최대공약수와 최소공배수 (0) | 2021.08.19 |
[C++ / 백준 11279] 최대 힙 (0) | 2021.08.17 |
[C++ / 백준 5086] 배수와 약수 (0) | 2021.08.16 |
[C++ / 백준 2164] 카드2 (0) | 2021.08.13 |