Garbage Classification
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

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 (), 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 () consisting of only lowercase letters.

The second line contains a string t of length 26, consisting of only characters in . 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 () denotes the garbage type of the product in this test case.
示例1

输入

复制
4
dqxxjefgctjgdbqxphff
hddhddhhhdhdhwwddhhdwwdhhw
iqdvfzzdqsbdevzebego
wdhddwwhwhdhhhwwdwdhwdwhhd
erkjqzsmchcmbqeasadf
dwddddwdwdwhdwhhdhhwwhhwdh
mcxkwmxxlhbrymwawhio
ddhwhddhwwwdddwdwhwwwhdwdw

输出

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