26 lines
601 B
Java
26 lines
601 B
Java
package LanQiaoOJ;
|
||
|
||
import java.util.ArrayList;
|
||
import java.util.Collections;
|
||
import java.util.Scanner;
|
||
|
||
public class Ñ°ÕÒÈý¸öÊýµÄ×î´ó³Ë»ý3 {
|
||
static int N=1010;
|
||
static int []a=new int [N];
|
||
|
||
public static void main(String[] args) {
|
||
Scanner sc=new Scanner(System.in);
|
||
int n=sc.nextInt();
|
||
ArrayList<Integer>list=new ArrayList<>();
|
||
for(int i=0;i<n;i++) {
|
||
int x=sc.nextInt();
|
||
list.add(x);
|
||
}
|
||
Collections.sort(list);
|
||
int ans=list.get(n-1)*list.get(n-2)*list.get(n-3);
|
||
ans=Math.max(ans, list.get(0)*list.get(1)*list.get(n-1));
|
||
System.out.print(ans);
|
||
}
|
||
|
||
}
|