백준

백준 1037 - Java

으엉어엉 2024. 9. 11. 11:55
728x90

import java.util.Arrays;
import java.util.Scanner;

public class TrivialDivisor {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int[] num = new int[N];

        for (int i=0;i<N;i++){
            int b=sc.nextInt();
            num[i]=b;
        }
        //정렬
        Arrays.sort(num);
        System.out.println(num[0]*num[N-1]);
    }
}
728x90

'백준' 카테고리의 다른 글

백준 26069 - Java  (0) 2024.09.12
백준 25192 - Java  (0) 2024.09.11
백준 11050 - Java  (0) 2024.09.09
백준 10872 - Java  (0) 2024.09.09
백준 24723 - Java  (0) 2024.09.09