ZOJ Problem Set - 3864
Exo (Korean: 엑소; Chinese:爱咳嗽; often stylized as EXO) is a Chinese-South Korean boy band based in Seoul, South Korea. Formed by SM Entertainment in 2011, the group consists of twelve members separated into two subgroups, EXO-K and EXO-M, performing music in Korean and Mandarin, respectively. The group officially debuted on April 8, 2012, with Suho, Baekhyun, Chanyeol, D.O, Kai, and Sehun under the Korean subgroup while Xiumin, Luhan, Kris, Lay, Chen, and Tao are under the Mandarin group. Kris filed a lawsuit against S.M. to be removed from the group, and Luhan followed suit in October 2014. The band now promotes with 10 members since mid-October 2014, which consists of 8 Korean and 2 Chinese members.
In their first album, each member of EXO has a kind of super power. For example, Tao can control time and Lay has a super power of healing. The badges are the symbols of their super powers. Each member of EXO has an unique badge. The following table shows the shapes of their badges.
EXO’s official fanclub name has been announced to be EXO-L. EXO-L is short for EXO-LOVE, L being the letter between M and K in the alphabet, signifying all the fans' love for both EXO-K and EXO-M of EXO, and also holds the meaning of 'EXO and the fans are one' like their team slogan 'WE ARE ONE.'
You should help an EXO-L pass a quiz about image recognition. The quiz requires a program to recognize the badges. The input is one of the above 12 images with rotation, and the output should be the owner of the badge in the image. The badge is rotated at an unknown angle. And each image is a square matrix. The badges will never touch or exceed the boundary of the image.
Since the images are large, we will compress the images. Each pixel in the image is either 1(white) or 0(black) after binarization. The compress method is simple:
For example, an image in size 6×6:
111111 100101 100011 110111 101001 111111
1111111 00 1 0 11 000 1111 0 1111 0 1 00 1111111
7 2 1 1 2 3 4 1 4 1 1 2 7
There are multiple test cases. The first line of input contains an integer T indicating the number of test cases. For each test case:
The first line contains 2 integers n and m. n is the size of the square image. m is the number of the runs in the compressed images. (100≤ n ≤ 900)
The second line contains m positive integers, indicating the length of the each runs in the compressed image. (The sum of the integers is n2).
For each case, output the owner of the badge in one line. Your output should be formated as one of following words: "Suho", "Baekhyun", "Chanyeol", "D.O", "Kai", "Sehun", "Xiumin", "Luhan", "Kris", "Lay", "Chen", and "Tao".
The images in the sample input are visualized as:
Author: ZHOU, Yuchen
Source: The 15th Zhejiang University Programming Contest