#605. 「Nowcoder多校 2019 Day6」Garbage Classification

「Nowcoder多校 2019 Day6」Garbage Classification

当前没有测试数据。

题目描述

On the CVBB planet, garbage classification has been gradually executed to help save resources and protect the environment. Nowadays people have to be equipped with knowledge of distinguishing different types of garbage. Now, given the waste compositions of a discarded product, you are asked to determine which category it belongs to. The waste compositions are represented as a string s consisting of only lowercase letters, where each letter represents a waste composition and has an equal proportion. Each waste composition in that product is in one of the three situations, dry, wet or harmful. The product can be classified by the following rules: In case that at least 25% of its compositions is harmful, it is harmful garbage. In case that at most 10% of its compositions is harmful, it is recyclable garbage. In other cases, if the proportion of dry compositions in it is at least twice that of wet compositions, it is dry garbage, or otherwise, it is wet garbage.

输入格式

There are multiple test cases. The first line contains an integer T (1T501 \leq T \leq 50), indicating the number of test cases. Test cases are given in the following.For each test case, the first line contains a non-empty string s (1s20001 \le |s| \le 2000) consisting of only lowercase letters.The second line contains a string t of length 26, consisting of only characters in {d,w,h}\lbrace d, w, h \rbrace. The i-th character of t represents the situation of the waste composition denoted by the i-th lowercase letter, where 'd', 'w' and 'h' mean dry, wet or harmful respectively.

输出格式

For each test case, output "Case #x: y" in one line (without quotes), where x indicates the case number starting from 1, and y ($y \in \lbrace \text{Harmful}, \text{Recyclable}, \text{Dry}, \text{Wet} \rbrace$) denotes the garbage type of the product in this test case.

样例

样例输入 1

4
dqxxjefgctjgdbqxphff
hddhddhhhdhdhwwddhhdwwdhhw
iqdvfzzdqsbdevzebego
wdhddwwhwhdhhhwwdwdhwdwhhd
erkjqzsmchcmbqeasadf
dwddddwdwdwhdwhhdhhwwhhwdh
mcxkwmxxlhbrymwawhio
ddhwhddhwwwdddwdwhwwwhdwdw

样例输出 1

Case #1: Harmful
Case #2: Recyclable
Case #3: Dry
Case #4: Wet