{"raw_statement":[{"iden":"statement","content":"Friday nights are tricky for UFPE's ICPC competitors - they must be careful with their plans, after all, they train on saturdays and must be in good shape to help their team. Beza, however, went to a party on his friday night and said that no booze could bring him down. He was wrong.\n\nBeza's night had $N$ hours, the party's bar had $M$ distinct beverages and, at each of the $N$ hours, Beza went to the bar and got one of the $M$ drinks. Lucas, who is an experienced drinker, said that a competitor would not be hungover the next day if the total volume of alcohol he drank did not exceed half the number of minutes he spent drinking.\n\nSaturday morning, Beza woke up and noticed he was terribly hungover, and this made him think about the things he did on that night. Since Beza has got a nasty headache, he's not able to think clearly, and, therefore, asks you to help him answer some questions he has about that night.\n\nBeza's questions can be of two types: \n\nThe first line of input consists of three integers $N$, $M$, and $Q$, ($1 <= N, M, Q <= 2 dot.op 10^5$). The next line contains $N$ strings $D_i$, $1 <= bar.v D_i bar.v <= 20$, each one describing the name of the $i$-th drink Beza had that night. Then, $M$ lines follow, each one containing two entries $S$ and $V$, $1 <= bar.v S bar.v <= 20$, $1 <= V <= 100$, which describe, respectively, the name of a drink the bar had and how many liters of alcohol it had. Finally, $Q$ lines follow, each one containing three integers, as described on the problem's statement.\n\nFor all queries of type $2$, you must answer \"YES\" if Beza would be hungover the next day, given the interval of hours on which he would be drinking, and \"NO\" otherwise. It is guaranteed that there will be at least one query of type $2$.\n\nThe total amount of hours passed by on a given interval $[ L, R ]$ is $R -L + 1$.\n\n"},{"iden":"input","content":"The first line of input consists of three integers $N$, $M$, and $Q$, ($1 <= N, M, Q <= 2 dot.op 10^5$). The next line contains $N$ strings $D_i$, $1 <= bar.v D_i bar.v <= 20$, each one describing the name of the $i$-th drink Beza had that night. Then, $M$ lines follow, each one containing two entries $S$ and $V$, $1 <= bar.v S bar.v <= 20$, $1 <= V <= 100$, which describe, respectively, the name of a drink the bar had and how many liters of alcohol it had. Finally, $Q$ lines follow, each one containing three integers, as described on the problem's statement."},{"iden":"output","content":"For all queries of type $2$, you must answer \"YES\" if Beza would be hungover the next day, given the interval of hours on which he would be drinking, and \"NO\" otherwise. It is guaranteed that there will be at least one query of type $2$."},{"iden":"note","content":"The total amount of hours passed by on a given interval $[ L, R ]$ is $R -L + 1$."}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ N, M, Q \\in \\mathbb{Z}^+ $ denote the number of hours, distinct beverages, and queries, respectively.  \nLet $ D = (d_1, d_2, \\dots, d_N) $ be the sequence of drink names consumed over $ N $ hours.  \nLet $ V: \\mathcal{S} \\to \\mathbb{Z}^+ $ be a mapping from drink names to their alcohol volume (in liters), where $ \\mathcal{S} $ is the set of $ M $ distinct drink names.  \n\n**Constraints**  \n1. $ 1 \\le N, M, Q \\le 2 \\cdot 10^5 $  \n2. For all $ i \\in \\{1, \\dots, N\\} $, $ d_i \\in \\mathcal{S} $  \n3. For all drink names $ s \\in \\mathcal{S} $, $ 1 \\le V(s) \\le 100 $  \n\n**Objective**  \nFor each query of type 2, given an interval $[L, R]$:  \n- Compute total alcohol consumed: $ A = \\sum_{i=L}^{R} V(d_i) $  \n- Compute total minutes spent drinking: $ T = 60 \\cdot (R - L + 1) $  \n- Output \"YES\" if $ A > \\frac{T}{2} $, otherwise \"NO\".","simple_statement":"Beza drank one drink per hour for N hours. Each drink has a name and a fixed alcohol volume. For each query, given a time range [L, R], check if the total alcohol drunk in those hours exceeds half the number of minutes spent (which is 60*(R-L+1)/2). If yes, print \"YES\" (hungover); if no, print \"NO\".","has_page_source":false}