시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 1024 MB | 44 | 32 | 31 | 72.093% |
Snowflakes can be symmetrical both vertically and horizontally. Snowflakes that aren’t symmetrical are useless. A snowflake is essentially a two dimensional array of features. A feature is a single digit between 0 and 9. Horizontal symmetry occurs if you flip the snowflake horizontally. It is still the same snowflake. Likewise, vertical symmetry is defined in the same way. A snowflake is “Beautiful” if its horizontally symmetrical, “Graceful” if its vertically symmetrical, and “Magnificent” if it is both. Otherwise it is “Useless”. For each snowflake, print what kind of snowflake it is.
The first line of data contains n, the number of inputs. Each input starts with a single integer k, k ≤ 20, denoting the dimension of the square snowflake. Then k lines follow with each line containing a string of length k denoting the digits in the snowflake.
For each input. print the type of snowflake.
3 3 123 321 143 2 11 11 3 121 232 343
Useless Magnificent Graceful