---
{"category_name":"school","problem_code":"REDALERT","problem_name":"Red Alert","problemComponents":{"constraints":"- $1 \\leq T \\leq 10^3$\n- $1 \\leq N, D \\leq 10^2$\n- $0 \\leq A_i \\leq 10^2$ for each valid $i$\n- $1 \\leq H \\leq 10^4$","constraintsState":true,"subtasks":"**Subtask #1 (100 points):** original constraints\n","subtasksState":true,"inputFormat":"- The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.\n- The first line of each test case contains three space-separated integers $N$, $D$ and $H$.\n- The second line contains $N$ space-separated integers $A_1, A_2, \\ldots, A_N$.\n","inputFormatState":true,"outputFormat":"For each test case, print a single line containing the string `\u0022YES\u0022` if there will be a red alert or `\u0022NO\u0022` otherwise.\n","outputFormatState":true,"sampleTestCases":{"0":{"id":1,"input":"4\n4 2 6\n1 3 0 2\n2 1 100\n1 100\n4 2 3\n1 2 0 2\n3 7 10\n5 3 9 \n","output":"NO\nYES\nNO\nYES","explanation":"**Example case 1:**\n- On the first day, the water level of the city increases to $1$ millimtre.\n- On the second day, the water level increases by $3$ millimeters and becomes $1 + 3 = 4$ millimtres.\n- On the third day, there is no rain in the city, so the water level decreases by $D = 2$ millimtres and becomes $4 - 2 = 2$ millimtres.\n- On the fourth day, the water level increases by $2$ millimtres and becomes $2 + 2 = 4$ millimtres.\n\nThere will be no red alert in the city because the water level does not exceed $H = 6$ millimtres on any of the four days.\n\n**Example case 2:** The water level of the city on the $2$-nd day is equal to $101$ millimtres, which is greater than $H = 100$ millimtres, so there will be a red alert in the city.\n\n**Example case 3:** The water levels of the city on the four days are $[1, 3, 1, 3]$. The water level is equal to $H = 3$ millimtres on the second and fourth day, but it does not exceed the threshold.\n\n**Example case 4:** There will be a red alert in the city on the $3$-rd day.\n","isDeleted":false}}},"video_editorial_url":"https://youtu.be/PnnpQujKuM8","languages_supported":{"0":"CPP14","1":"C","2":"JAVA","3":"PYTH 3.6","4":"CPP17","5":"PYTH","6":"PYP3","7":"CS2","8":"ADA","9":"PYPY","10":"TEXT","11":"PAS fpc","12":"NODEJS","13":"RUBY","14":"PHP","15":"GO","16":"HASK","17":"TCL","18":"PERL","19":"SCALA","20":"LUA","21":"kotlin","22":"BASH","23":"JS","24":"LISP sbcl","25":"rust","26":"PAS gpc","27":"BF","28":"CLOJ","29":"R","30":"D","31":"CAML","32":"FORT","33":"ASM","34":"swift","35":"FS","36":"WSPC","37":"LISP clisp","38":"SQL","39":"SCM guile","40":"PERL6","41":"ERL","42":"CLPS","43":"ICK","44":"NICE","45":"PRLG","46":"ICON","47":"COB","48":"SCM chicken","49":"PIKE","50":"SCM qobi","51":"ST","52":"SQLQ","53":"NEM"},"max_timelimit":0.5,"source_sizelimit":50000,"problem_author":"soumyadeep_21","problem_tester":"","date_added":"22-07-2021","tags":{"0":"cakewalk","1":"ltime98","2":"soumyadeep_21"},"problem_difficulty_level":"Cakewalk","best_tag":"","editorial_url":"https://discuss.codechef.com/problems/REDALERT","time":{"view_start_date":1627745402,"submit_start_date":1627745402,"visible_start_date":1627745402,"end_date":1735669800},"is_direct_submittable":false,"problemDiscussURL":"https://discuss.codechef.com/search?q=REDALERT","is_proctored":false,"visitedContests":{},"layout":"problem"}
---
### Read problem statements in [Mandarin](https://www.codechef.com/download/translated/LTIME98/mandarin/REDALERT.pdf), [Bengali](https://www.codechef.com/download/translated/LTIME98/bengali/REDALERT.pdf), [Russian](https://www.codechef.com/download/translated/LTIME98/russian/REDALERT.pdf), and [Vietnamese](https://www.codechef.com/download/translated/LTIME98/vietnamese/REDALERT.pdf) as well.
Finally a monsoon has come. According to the Meteorological Department, there will be rain in the upcoming $N$ days in the city. Initially, the water level of the city is zero millimetres. The amount of rain on the $i$-th day can be described by an integer $A_i$ as follows:
- If $A_i \gt 0$, the water level of the city increases by $A_i$ millimetres on the $i$-th day.
- If $A_i = 0$, there is no rain on the $i$-th day. The water level of the city decreases by $D$ millimetres on such a day. However, if the water level is less than $D$ millimetres before the $i$-th day, then it becomes zero instead.
There will be a red alert in the city if the water level becomes strictly greater than $H$ millimetres on at least one of the $N$ days. Determine if there will be a red alert.
<aside style='background: #f8f8f8;padding: 10px 15px;'><div>All submissions for this problem are available.</div></aside>