Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Блог пользователя megahertz13

Автор megahertz13, история, 5 часов назад, По-английски

Post your code in the comments to get featured.

B. Name Change

Input file: standard input

Output file: standard output

Time limit: 1 second

Memory limit: 256 megabytes

MegaMath Channel is trying to change its name. A new name with no spaces is called valid if it is distinct from "MegaMath Channel" and it is a permutation of the letters (exclude the space) in "MegaMath Channel". For example, "MegaChanneMathl" is a valid new name, while "MegaChanne Mathl" is not (it has a space). Your task is to find whether a given name is valid or not.

Input

The first line contains the number of names t (1 <= t <= 1000).

The next n lines contain a single string n, where n is a possible name.

Output

Output "Yes" if a given name is valid, and output "No" otherwise.

Sample Code by [blank]:

  • Проголосовать: нравится
  • -19
  • Проголосовать: не нравится

»
5 часов назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I think you better prepare 100 problems and create a mashup to participate instead. To do this, you need to register to polygon and do create some problems first.

  • »
    »
    4 часа назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    I'll turn this into a contest (with different problems). Do you know how to do that?

    • »
      »
      »
      2 часа назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      bump