#ABC472C. 节食 / On a Diet
节食 / On a Diet
Problem Statement
Takahashi is staying at his parents' house for an -day homecoming trip.
At his parents' house, a snack is prepared every day, and the calorie count of the snack on day is .
To manage his health, he repeats the following: he eats the snack on a given day if and only if the total calorie count of the snacks he has eaten in the most recent days does not exceed .
Specifically, in the order , he decides whether to eat the snack on day according to the following rule:
- Assuming that he eats the snack on day , if the total calorie count of the snacks eaten from day through day is at most , then he actually eats the snack on day . Otherwise, he does not eat the snack on day .
For each , determine whether Takahashi eats the snack on day .
Constraints
- All input values are integers.
Input
Output
Output lines. The -th line should contain Yes if Takahashi eats the snack on day , and No otherwise.
5 3 83
48 73 59 90 21
Yes
No
No
No
Yes
For each day, assuming that he eats the snack, the total calorie count of the snacks eaten in the most recent three days is as follows:
- Day :
- Day :
- Day :
- Day :
- Day :
7 4 728
187 816 349 609 255 308 175
Yes
No
Yes
No
Yes
No
Yes
10 3 1368290936
216519459 804733999 297250023 775422599 287963235 999315644 354987425 974810607 653940822 117157941
Yes
Yes
Yes
No
Yes
Yes
No
No
Yes
Yes
- Source: AtCoder ABC 472 C
相关
在下列比赛中: