Олимпиадный тренинг

Задача 38500. Minimum product


Задача

Темы:
Given a sequence of N integers (they can be positive,  negative or equal to 0). It is necessary to choose two numbers from these numbers so that their product is as small as possible (the squares of these numbers are not considered, but you can choose the product of two different elements of the sequence that are equal to each other).
The first line of the input contains an integer N, 2 ≤ N ≤105 – the number of given numbers. The next N lines contain the numbers themselves, modulo not exceeding 40,000.
The program should output a single integer – the smallest possible product of two distinct elements of this sequence.
Examples
# Input Output
1 3
1
-3
2
-6