## Maximum Product of K Integers

View as PDF

Points: 25
Time limit: 1.0s
Memory limit: 1G

Problem type

You're given a sequence of integers. Let be the product of all integers in sequence . Over all subsequences of length of the original sequence, compute the maximum possible value of .

Unlike other problems on DMOJ, the data for this problem will be user-contributed, leveraging DMOJ's ability to look at solutions that have AC on them. If you have a test case to contribute, please DM it to xiaowuc1 along with the ID of another user's submission that fails the provided test case, and your submission that passes on the given test case. Credit for test data will be given in the problem statement.

Users who copy other persons' submissions will be banned from submitting to this problem.

Number of test cases present: 13

1. Sample.
2. Sample.
3. Provided by ksun48.
4. Provided by wleung_bvg.
5. Provided by Rimuru.
6. Provided by Rimuru.
7. Provided by Rimuru.
8. Provided by Beautiful_Times.
9. Provided by d.
10. Provided by d.
11. Provided by xiaowuc1.
12. Provided by d.
13. Provided by d.

.

#### Input Specification

The first line contains two space-separated positive integers, and .

The next line contains space-separated integers, the sequence of integers .

#### Output Specification

Output the maximum possible product.

#### Sample Input

1 1
1

#### Sample Output

1

#### Sample Input

1 1
0

#### Sample Output

0