Skip to content

Instantly share code, notes, and snippets.

@dalcon10028
Created January 22, 2020 14:22
Show Gist options
  • Select an option

  • Save dalcon10028/6974b7d12576ba60c3a58f241fae46a4 to your computer and use it in GitHub Desktop.

Select an option

Save dalcon10028/6974b7d12576ba60c3a58f241fae46a4 to your computer and use it in GitHub Desktop.
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int[] realDivisor = new int[N];
for(int i=0; i<N; i++)
realDivisor[i] = sc.nextInt();
sc.close(); Arrays.sort(realDivisor);
System.out.print(realDivisor[0]*realDivisor[N-1]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment