第十四篇英语翻译


重点单词:

commission v/n.委托, 佣金, 委员会, 命令

prevail v.现行,流行, 盛行;

par n.标准;

crystal n.结晶, 水晶, 晶体;

gaze v.凝视;

greenback n. 钞票,美元;

fraction n.分数, 小数, 部分;

出处:https://acs.jxnu.edu.cn/problem/NOIOPJCH02062421

Exchange Rates

 1000ms  65536K

描述:

Now that the Loonie is hovering about par with the Greenback, you have decided to use your $1000 entrance scholarship to engage in currency speculation. So you gaze into a crystal ball which predicts the closing exchange rate between Canadian and U.S. dollars for each of the next several days. On any given day, you can switch all of your money from Canadian to U.S. dollars, or vice versa, at the prevailing exchange rate, less a 3% commission, less any fraction of a cent.
Assuming your crystal ball is correct, what's the maximum amount of money you can have, in Canadian dollars, when you're done?

现在,加拿大的货币与美元的价格持平,你决定用1000美元的入学奖学金从事货币投机。因此,你凝视着一个水晶球,它能预测未来几天加拿大和美元之间的收盘汇率。在任何一天,你都可以按照现行汇率,减去3%的佣金,将你所有的钱从加拿大换成美元,反之亦然。

假设你的水晶球是正确的,当你完成后,你能拥有的最高金额是多少(以加元计)?


输入:

The input contains a number of test cases, followed by a line containing 0. Each test case begins with 0 , the number of days that your crystal ball can predict. d lines follow, giving the price of a U.S. dollar in Canadian dollars, as a real number. 输入包含多个测试用例,后跟一行0。每个测试用例从0输出: For each test case, output a line giving the maximum amount of money, in Canadian dollars and cents, that it is possible to have at the end of the last prediction, assuming you may exchange money on any subset of the predicted days, in order. 对于每个测试用例,输出一行,给出在上一次预测结束时可能拥有的最大金额,以加元和美分为单位,假设您可以按顺序在预测日期的任何时期上兑换货币。

样例输入:

3
1.0500
0.9300
0.9900
2
1.0500
1.1000
0

样例输出:

1001.60
1000.00

注释:

Source: Waterloo

相关