Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб. Question by Ibrahim Mesecan.
Contacts List
You are required to build a very simple application
that can search for the contacts stored in the phone
by taking a query from the user.
Question:
Take the list of the contacts and a query string and decide
if each of the contacts contains in it or not.
Input specification
You will be given an integer (1 <= n <= 50000) which
represents the number of the contacts. In another line,
you will get a short query (a String composed only of 2
characters). In the following n lines, you will get the
name of each contact (a String of length at most 10 characters).
Output specification
Show each of the names that contains the query
in the same order as in the input. If there is no match,
show the message "No matching." without the quotes.
Sample Input I
5
an
Agim
Dorian
Ardit
Arjan
Agon
|
Sample Output I
Dorian
Arjan
|
Для отправки решений необходимо выполнить вход.
|