22662_Produc

2022-5-16 18:22| 发布者: Hocassian| 查看: 23| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-5-89506832389000-Problem List-采集的数据-后羿采集器.html

Pro.ID

22662

Title

Product

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22662

AC

0

Submit

4

Ratio

0.00%

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 32768/32768 K (Java/Others)
  • 描述

    There is an array of N integer numbers in the interval from -30000 to 30000. The task is to select K elements of this array with maximal possible product.

    输入

    The input consists of N+1 lines. The first line contains N and K ( 1 ≤ KN ≤ 100 ) separated by one or several spaces. The others contain values of array elements.

    输出

    Description

    There is an array of N integer numbers in the interval from -30000 to 30000. The task is to select K elements of this array with maximal possible product.

    Input

    The input consists of N+1 lines. The first line contains N and K ( 1 ≤ KN ≤ 100 ) separated by one or several spaces. The others contain values of array elements.

    Output

    Output a single line with values of selected elements separated by one space. These values must be in non-increasing order.

    Sample Input

    4 2
    1
    7
    2
    0

    Sample Output

    7 2

    Source

    样例输入

    4 2
    1
    7
    2
    0

    样例输出

    7 2

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部