P8466 [Aya Round 1 A] Gensokyo Poker Game

Background

**Problem Number:** [$\textit{22}$](https://www.luogu.com.cn/training/1392) After the Ability Card Incident, the girls of Gensokyo collected the extra cards and, imitating an outside game called “Dou Dizhu” (Dou Dizhu), played happily.

Description

Dou Dizhu is a game played with a total of $54$ poker cards: $\tt A$ to $\tt K$ plus the small joker and the big joker. There is one small joker and one big joker, and for each other rank there are four cards. In Dou Dizhu, the order of card ranks is as follows: $$\tt 3

Input Format

**This problem contains multiple test cases.** - The first line contains an integer $T$, the number of test cases. - The next $T$ lines each contain a string of length $17$, representing your hand. **It is guaranteed that the cards have already been sorted.** In the input, $\tt T$ represents a card of rank $\tt 10$, $\tt X$ represents the small joker, and $\tt D$ represents the big joker.

Output Format

- Output $T$ lines in total. - For each test case, output one string per line: - `yes` means you should call landlord. - `no` means you should not call landlord. - You may output the string in any letter case. For example, `yes`, `Yes`, and `YES` are all accepted as meaning you should call landlord.

Explanation/Hint

### Sample Explanation > For test case $1$, the input corresponds to the following hand (ignoring suits): > > ![](https://cdn.luogu.com.cn/upload/image_hosting/g56d0ywv.png) > > There is a bomb in this hand: > > ![](https://cdn.luogu.com.cn/upload/image_hosting/6sal0bye.png) > > So you choose to call landlord. > For test case $2$, the input corresponds to the following hand (ignoring suits): > > ![](https://cdn.luogu.com.cn/upload/image_hosting/6g2jrx6t.png) > > There is a rocket in this hand: > > ![](https://cdn.luogu.com.cn/upload/image_hosting/1ulc1sxz.png) > > So you choose to call landlord. > For test case $3$, the input corresponds to the following hand (ignoring suits): > > ![](https://cdn.luogu.com.cn/upload/image_hosting/5qb6bwen.png) > > There is no rocket and no bomb in this hand. So you choose not to call landlord. ### Constraints and Notes For $100\%$ of the testdata, $1 \le T \le 10^4$. **It is guaranteed that the cards have already been sorted.** Translated by ChatGPT 5