Minimum product pair
Basic Accuracy: 26.9% Submissions: 5526 Points: 1

Given an array of positive integers. The task is to print the minimum product of any two numbers of the given array.

Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case consists of two lines. First line of each test case contains a integer N and the second line contains N space separated array elements.

Output:
For each test case, print the minimum product of two numbers in new line.

Constraints:
1<=T<=100
2<=N<=105
1<=A[i]<=105

Example:
Input:

2
4
2 7 3 4
4
5 3 6 4

Output:
6
12

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.