Corruption
Hard
Execution time limit is 0.1 seconds
Runtime memory usage limit is 64 megabytes
With the purpose of fight against a shadow economy a bank inculcated merging of the N
accounts of a company into one. For one operation 2 accounts are merged into one and bank automatically takes its own charge fee of Р
% from the new account total for this operation. What is the most funds which could remain on the company' account? Each account has maximum charge of G
UAH before merging.
Input
In the first line we have 2 numbers: amount of accounts and the fee percentage P
.
The second line of N
numbers: the charge of each company' accounts.
Output
Most sum, that can remain on the account.
2 ≤ N ≤ 100000
0 ≤ Р ≤ 20
0 ≤ G ≤ 10000
Examples
Input #1
Answer #1
Submissions 25K
Acceptance rate 4%