#ABC472C. 节食 / On a Diet

节食 / On a Diet

Problem Statement

Takahashi is staying at his parents' house for an NN-day homecoming trip.

At his parents' house, a snack is prepared every day, and the calorie count of the snack on day ii is AiA_i.

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 MM days does not exceed KK.

Specifically, in the order i=1,2,,Ni=1,2,\dots,N, he decides whether to eat the snack on day ii according to the following rule:

  • Assuming that he eats the snack on day ii, if the total calorie count of the snacks eaten from day max(iM+1,1)\max(i-M+1,1) through day ii is at most KK, then he actually eats the snack on day ii. Otherwise, he does not eat the snack on day ii.

For each i=1,2,,Ni=1,2,\dots,N, determine whether Takahashi eats the snack on day ii.

Constraints

  • 1MN2×1051 \leq M \leq N \leq 2 \times 10^5
  • 1K10151 \leq K \leq 10^{15}
  • 1Ai1091 \leq A_i \leq 10^9
  • All input values are integers.

Input

  • NN MM KK
  • A1A_1 A2A_2 \dots ANA_N

Output

Output NN lines. The ii-th line should contain Yes if Takahashi eats the snack on day ii, 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 11: 4848
  • Day 22: 48+73=12148+73=121
  • Day 33: 48+59=10748+59=107
  • Day 44: 9090
  • Day 55: 2121
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