HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Functions > problem:


190. 50533 - Contacts List

Guest
• Review clarifications (1)

Volume problems

• 050. 50510 - What floor are they?
• 050. 50566 - Grade Point Average (...
• 066. 50523 - Total Tax to Pay
• 070. 50534 - Top Trading Company
• 095. 50453 - The Cubic Difference
• 125. 50578 - Mersenne prime
• 132. 50474 - Sum of Two Primes
• 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
• 50307 - Palindromes
• 50305 - John's Tasks
• 002. 50428 - Three Times
• 010. 50582 - Number of digits

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