Skip to content

Panda has started learning about subsets. His professor gave him a simple task. Given a list of numbers, Panda has to choose the subset which gives the maximum product. However, the professor asked Panda only to submit the maximum product obtained by taking exactly two numbers from the list. Please help Panda in finding out the answer to this as…

Notifications You must be signed in to change notification settings

DJasmineJoyline/Panda-And-Max-product

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Panda-And-Max-product

Panda has started learning about subsets. His professor gave him a simple task. Given a list of numbers, Panda has to choose the subset which gives the maximum product. However, the professor asked Panda only to submit the maximum product obtained by taking exactly two numbers from the list. Please help Panda in finding out the answer to this assignment.

Input Format:

The first line will contain the integer N, the length of the array.

The next line contains N space separated integers.

Output Format: For each test case, output Panda's query.

Constraints:

2 <= N <= 105

Subtask 1: (25 points) 0 <= Integers <= 109

Subtask 2: (75 points) -109 <= Integers <= 109

SAMPLE INPUT 2 2 3

SAMPLE OUTPUT 6

Explanation The only combination possible is {2,3} whose product is 6 .

About

Panda has started learning about subsets. His professor gave him a simple task. Given a list of numbers, Panda has to choose the subset which gives the maximum product. However, the professor asked Panda only to submit the maximum product obtained by taking exactly two numbers from the list. Please help Panda in finding out the answer to this as…

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages