-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathICPC.E.cpp
More file actions
36 lines (35 loc) · 724 Bytes
/
ICPC.E.cpp
File metadata and controls
36 lines (35 loc) · 724 Bytes
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
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int i,cnt=0;
long long a[4];
cin >> a[0]>>a[1]>>a[2]>>a[3];
sort(a,a+4);
for(i=0;i<2;i++){
if(a[i]==a[i+1]){
cnt++;
}
}
if(cnt==3){
cout << a[0]*a[0] << "\n";
}
else if(cnt==2&&a[1]!=a[2]){
cout << a[0]*a[2] << "\n";
}
else if(cnt==2&&a[1]==a[2]){
cout << a[0]*a[0] << endl;
}
else if(cnt==1){
cout << a[0]*a[2] <<"\n";
}
else if(cnt==0){
cout << a[0]*a[2] << "\n";
}
}
return 0;
}