電泡泡

## Problem G: Mahjong problem

Time Limit: 1 Sec   Memory Limit: 128 MB
Submit: 0   Solved: 0
[ Submit][ Status][ Web Board]

## Description

In Chinese, Mahjong is the mean of ‘MaJiang’, as we know, Dremone is very fond of mahjong, he is always
very bored, and he wants to teach the cat of his house to play mahjong, if she can also play it, dreamone can
play it with her happily.
In dremone’s mahjong, there is only a single kind of Mahjong Tile which is from 1 to 9. Firstly, Dremone
wants to describe the rules about mahjong:
 A Pong, or Pung, is a set of three identical tiles.
For example:1 1 1; 7 7 7;
 A Chow is a meld of three suited tiles in sequence.
For example: 1 2 3; 3 4 5; 4 5 6; 5 6 7;
 An Eye is the pair; it consists of any two identical tiles.
For example: 1 1; 2 2; 3 3;
If you have only an Eye and many Pongs or many Chows, you will be ‘HuPai’. If you are only in the status
of being short of a single tile, you will be called ‘Hearing Tile’. If you want to be ‘HuPai’ only if there is 2
Mahjong tiles or 5 or 8 or 11 or 14 Mahjong tiles in your hands. So if you are not being the status of ‘HuPai’,
there is always 1 Mahjong tiles or 4 or 7 or 10 or 13 Mahjong tiles in your hands.
As we know, if you are in the status of ‘HuPai’, there will be no more than 4 for each kind of ‘Mahjong Tile’
from 1 to 9.
What’s more, If you get the Mahjong Tiles such as : 4 4 4 4 ,According to the rules above, you have been in
the status of ‘Hearing Tile’ ,and if you can get another 4,you will be ‘HuPai’,but it is impossible for you to
achieve it, because of the limitation about the numbers for each Tile. So we use ‘Status A’ represented your
status.
Another case, if the Mahjong numbers will not be 1,4,7,10,13 before you are in the status of ‘HuPai’, we call
the status ‘Small Xianggong’. And we use ‘Status B’ represented it.
Of course, if you can ‘HuPai’ after you get another single tile, you should tell us which Tiles can you
‘HuPai’.for example:
If the tiles is described as:  1 2 3 4 .and you can ‘Hu’ 1 or 4.
If the tiles is described as:  2 2 3 3 .and you can ‘Hu’ 2 or 3.
If the tiles is described as:  2 2 3 3 4 4 4 .and you can ‘Hu’ 1 or 2 or 3 or 4.
Of course, you may not ‘HuPai’ if you get any single tile, such as:
If the tiles is described as:  1 3 4 3, or described as: 1 2 3 4 5 5 7, so you are in the status of ‘Can not
HuPai!’
Can you get the main idea?

## Input

The first line of input will be a positive integer C indicating how many data sets will be included. Each of
the C data sets will contain only a single line represented the brands .Each line will be ended with pressing
“Enter” key.

## Output

For each case, output ‘Status A’ or ‘Status B’ or ‘Can not HuPai!’ or the tiles you can ‘HuPai’ as the order
from small to big.

6

2 2 2 2

1 2 3 4

2 4

1 2 3 5 6 6 5

1 2 3 4 5 6

3 4 5 1 2 4 9

## Sample Output

Status A 1 4

Status B 5 6

Status B

Can not HuPai!

© 著作权归作者所有

### 電泡泡

AppleScript 判断按键事件的脚本文章收集

AppleScript support for SplitPanes 来自：http://code.google.com/p/iterm2/issues/detail?id=559 Reported by samantha...@gmail.com , Jan 29, 2011 Hi, I would like to be able to sc......

FreeBlues
2013/12/17
0
0

2018/06/27
0
0

@JFinal 你好，想跟你请教个问题：波哥，我用原生态连接SQL2000数据正常的，为啥用C3p0Plugin插件出现一下错误的！ Starting JFinal 1.5 Starting scanner at interval of 5 seconds. Start...

2013/12/17
971
3
STM32F4串口打印 while函数出错

2018/01/18
0
0
eclipse无法启动 An error has occurred. See the log file

2013/12/13
2.2K
1

XuePeng77

2
0
android 延长Toast的时长

4
0

Java开发中经常用到的日志框架有很多，Log4j、Log4j2、slf4j等等，Mybatis定义了一套统一的日志接口供上层使用，并为上述常用的日志框架提供了相应的适配器。有关适配器模式例子可以参考 设计...

13
0

em_aaron

3
0
Git cherry-pick 使用总结

9
0