Problem C: 定价

Problem C: 定价

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

有 lns="http://www.w3.org/1998/Math/MathML">n 个客户前来购买一款商品,其中第 lns="http://www.w3.org/1998/Math/MathML">i 名客户对这件商品的最高预算为 lns="http://www.w3.org/1998/Math/MathML">ai,如果商品的价格小于或等于 lns="http://www.w3.org/1998/Math/MathML">ai,客户 lns="http://www.w3.org/1998/Math/MathML">i 就会购买商品,反之则不会。

请你为商品定一个最优的价格,使得商家的总收入达到最高。商家的总收入是指购买商品的人数乘以商品的价格。

Input

  • 第一行:单个整数 lns="http://www.w3.org/1998/Math/MathML">n
  • 第二行:lns="http://www.w3.org/1998/Math/MathML">n 个整数 lns="http://www.w3.org/1998/Math/MathML">a1,a2,,an
  •  的分数,lns="http://www.w3.org/1998/Math/MathML">1n1,000
  • lns="http://www.w3.org/1998/Math/MathML">60% 的分数,lns="http://www.w3.org/1998/Math/MathML">1n5,000
  • lns="http://www.w3.org/1998/Math/MathML">100% 的分数,lns="http://www.w3.org/1998/Math/MathML">1n200,000lns="http://www.w3.org/1998/Math/MathML">1ai106

Output

  • 输出一个整数表示最大总收入。

Sample Input Copy

5
50 100 110 120 60

Sample Output Copy

300

HINT

设定商品价格为100元是最好的选择