当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

7121:Takeaway

题目描述
After CET-6, Kanari wants to order a takeaway to reward himself.

He opens choutuan app and starts to choose what to eat for his dinner. There are 7 types of dishes in total, the price of which are $7, 27, 41, 49, 63, 78, 108$ yuan respectively.

Kanari has three coupons:

1. When the price reaches $69$ yuan, you will get $15$ yuan off.

2. When the price reaches $89$ yuan, you will get $30$ yuan off.

3. When the price reaches $120$ yuan, you will get $50$ yuan off.

Kanari can only use one coupon each time and each coupon can only be used once. For each order, the app will always choose the best coupon for him.

For example, if the overall price of his order is $300$ yuan, he will need to pay $250$ yuan.

Now Kanari ordered $n$ dishes, $a_1, a_2, a_3, ..., a_n$, denoting the types of the dishes respectively. He wants to know how much he will spend on his dinner.
输入解释
This problem contains multiple test cases.

The first line contains a single integer $T$ ($1\leq T\leq 10^6$) indicating the number of test cases.

Then $T$ cases follow, each of which contains two lines.

The first line of each test case contains an integer $n$ ($1\leq n\leq 7$), the number of dishes Kanari ordered.

The second line contains $n$ integers $a_1,a_2,...,a_n$. ($1\leq a_i\leq 7$) indicating the dishes Kanari ordered.
输出解释
For each test case, output the money Kanari spends in a single line.
输入样例
5
2
2 3
3
2 3 4
6
1 1 4 5 1 4
1
1
7
7 7 7 7 7 7 7
输出样例
68
87
132
7
706

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-7121

最后修改于 2021-10-23T19:11:35+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
20000/10000MS(Java/Others) 262144/262144K(Java/Others)