HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Functions > problem:


190. 50533 - Contacts List

Guest
• Review clarifications (1)

Volume problems

• 135. 50572 - Palindromic Numbers
• 140. 50393 - Palindromic Numbers
• 145. 50586 - Prime Palindromes
• 148. 50412 - K numbers
• 150. 50375 - Area of Circles
• 160. 50388 - Number of Armstrong ...
• 160. 50571 - Armstrong Numbers - 2
• 165. 50577 - Perfect Numbers and ...
• 190. 50533 - Contacts List
• 200. 50454 - What day is it?
• 210. 50369 - Base Conversion
• 250. 50385 - The 3n + 1 problem
• 260. 50493 - n-digit kth Prime Number

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
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



Для отправки решений необходимо выполнить вход.

www.contester.ru