Problem D. maxsum
题号:NC229643
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Give you  numbers , define , obviously There are ,the person who made the question wants to know the top .

输入描述:

The first line is two integers 
The number of    in the second line, the number of    is  


输出描述:

Output the number of , which represents the answer, separated by spaces.
示例1

输入

复制
6 8
1 1 4 5 1 4

输出

复制
16 15 14 12 11 11 10 10
示例2

输入

复制
7 8
1 9 1 9 8 1 0

输出

复制
29 29 28 28 28 27 20 19