#Lutece2323. Help Fat_Dog Kill Bugs
Help Fat_Dog Kill Bugs
Migrated from Lutece 2323 Help Fat_Dog Kill Bugs
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
As you know, dogs are very cute and lovely. However, dogs are usually bugged by ants or other small insects. Fat_Dog is one of them who is bugged. His proper name suggests that he is heavy, but he's still very cute. I believe you are willing to help him solve this problem.
Let's simplify this problem. Fat_Dog has two abilities, valued and . What's more, he has magic books, and the -th book has a value . For each book, Fat_Dog can either increase by or decrease by . Fat_Dog wants to maximize so that he can kill bugs as many as possible. Please tell him the maximum value.
Input
The first line contains three integers , and ().
The second line contains integers. The -th number means the value of the -th book ().
Output
Print the maximum value of .
Samples
3 1 1
1 1 1
15
Resources
电子科技大学第十一届 ACM 趣味程序设计竞赛