/ OPS / 题库 /

The doomsday of the warrant

The doomsday of the warrant

#描述#
March 23, 2007 is the last trading day for the put warrant "Baotou Steel JTP1" (with the code of 580995). The warrant opened at the price 0.249 RMB, and closed at the price 0.006 RMB, fell 97.92% in that day. It is the doomsday of the warrant.

However, it is also a day with good opportunity to earn a lot of money. As a warrant, it can be bought and sold in the same day. That is, in one day, you can buy it at the price 0.200 and then sell it at the price 0.210, and then buy it back at the price 0.190 and sell it at the price 0.200...

The charges for both buy and sell are 0.15%. If you buy 10000 units of warrant at the price 0.200, then the charge will be 3 RMB (10000 * 0.200 * 0.0015), and the trade can be done only if there is at least 2003 RMB in your account. If you sell 10000 units of warrant at the price 0.200, then the charge will be 3 RMB (10000 * 0.200 * 0.0015), and the money back to your account is 1997 RMB.

In order to simplify the problem, arbitrary units of warrant can be bought. If you have 10000 RMB, and the price per unit is 0.200 RMB, you can buy any units of warrant between 0 (exclusive) and 10000 / (0.200 * 1.0015) (inclusive), e.g. 12345.12345 units.

Now given the prices for every moment in that day, please calculate the maximal profit percentage can be made in theory. Note: you must sell all warrant at the end.

#格式#
##输入格式##
This problem contains multiple test cases. Each test case starts with an integer N (1 &lt= N &lt= 100000, the number of moment). Then N lines follow, each line contains a value(of double type), indicating the price for that moment. The prices given are sorted by time.

##输出格式##
For each test case, output a line containing the maximal profit percentage can be made in theory. The percentage is to be printed accurately rounded to two decimals.

#样例1#
##样例输入1##

2
0.200
0.300
2
0.300
0.200

##样例输出1##

49.55%
0.00%

#限制#
1000ms
32768KB

#提示#

#来源#

信息

ID
1332
难度
5
分类
category1 点击显示
标签
递交数
0
已通过
0
通过率
?
上传者