#abc332a. A - Online Shopping
A - Online Shopping
Score : points
问题描述
AtCoder Inc. 通过其线上商店销售商品。
高桥决定从那里购买 种不同类型的商品。
对于从 到 的每个整数 ,第 类商品的单价为 日元,他将购买 件该商品。
另外,他还必须支付运费。
如果购买商品的总价达到或超过 日元,则运费为 日元,否则运费为 日元。
他需要支付购买商品的总价加上运费。
请计算他总共需要支付的金额。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
AtCoder Inc. sells merchandise through its online shop.
Takahashi has decided to purchase types of products from there.
For each integer from to , the -th type of product has a price of yen each, and he will buy of this.
Additionally, he must pay a shipping fee.
The shipping fee is yen if the total price of the products purchased is yen or above, and yen otherwise.
He will pay the total price of the products purchased plus the shipping fee.
Calculate the amount he will pay.
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the amount Takahashi will pay for online shopping.
Sample Input 1
2 2000 500
1000 1
100 6
Sample Output 1
2100
Takahashi buys one product for yen and six products for yen each.
Thus, the total price of the products is yen.
Since the total amount for the products is less than yen, the shipping fee will be yen.
Therefore, the amount Takahashi will pay is yen.
Sample Input 2
3 2000 500
1000 1
100 6
5000 1
Sample Output 2
6600
The total price of the products is yen.
Since the total amount for the products is not less than yen, the shipping fee will be yen.
Therefore, the amount Takahashi will pay is yen.
Sample Input 3
2 2000 500
1000 1
1000 1
Sample Output 3
2000
There may be multiple products with the same price per item.
update @ 2024/3/10 01:16:46