#K51412. Prize Counter Overflow
Prize Counter Overflow
Prize Counter Overflow
You are given a prize counter with a maximum capacity c and n players who submit tickets sequentially. Each player submits a certain number of tickets. The counter processes submissions one by one, accumulating tickets until all submissions are processed. At any point, if the cumulative sum of tickets exceeds the capacity c, the submission is rejected.
Formally, let \( t_1, t_2, ..., t_n \) be the numbers of tickets submitted by each player in order. Define the running total by \( S_k = \sum_{i=1}^{k} t_i \). The prize counter accepts the submissions if and only if \( S_k \leq c \) for all \( 1 \leq k \leq n \). Otherwise, if \( S_k > c \) at any point, it is rejected.
inputFormat
The input is read from stdin and consists of two lines:
First line: Two space-separated integers, n (the number of players) and c (the capacity of the prize counter).
Second line: n space-separated integers representing the number of tickets each player submits, in the order of submission.
outputFormat
Output a single line to stdout containing either "Accepted" if the prize counter can accommodate all submissions without overflow, or "Rejected" if the cumulative ticket count exceeds the capacity at any point.
## sample5 100
20 30 10 25 15
Accepted