#abc209b. B - Can you buy them all?
B - Can you buy them all?
Score : points
问题描述
高桥商店销售 种产品。第 个产品的常规价格是 日元(日本货币)。
今天商店举行特价促销,对于第 、 项以及随后所有偶数序号的产品,每件优惠 日元。而第 、 项以及随后所有奇数序号的产品按原价销售。
你现在拥有 日元。请问,你能否用这些钱购买全部 种产品呢?
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
Takahashi's shop sells products. The usual price of the -th product is yen (Japanese currency).
It has a bargain sale today, with a discount of yen off the usual prices for the -nd, -th, and the subsequent even-indexed products. The -st, -rd, and the subsequent odd-indexed products are sold for their usual prices.
You have yen. Can you buy all the products with this money?
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
If you can buy all the products, print Yes
; otherwise, print No
.
Sample Input 1
2 3
1 3
Sample Output 1
Yes
You can buy the -st product for yen and the -nd product for yen, yen off the usual price. You have just enough money, yen, to buy both of them.
Sample Input 2
4 10
3 3 4 4
Sample Output 2
No
You can buy these four products for yen, yen, yen, and yen, respectively. You need yen to buy all of them, and since you have only yen, you cannot buy all of them.
Sample Input 3
8 30
3 1 4 1 5 9 2 6
Sample Output 3
Yes
update @ 2024/3/10 09:22:29
相关
在下列比赛中: