time limit per test: 0.25
memory limit per test: 65536
After tremendous last-year success not yet well-known, but already grown-up company H&H decided to create a new software masterpiece -- a world-leading spam-filter.
Due to Your poor last year -- a world-leading spam-filter. Due to your poor last year project performance, you are given a small and boring task again.
Your task is to write a simple email-validator.
Valid email address can be described as follows:
<letter> ::= a|b|...|z|A|B|...|Z
<symbol> ::= <letter>|0|1|...|9|_|-
<word> ::= <symbol>|<symbol><word>
<prefix> ::= <word>|<prefix>.<word>
<domain> ::= <letter><letter>|<letter><letter><letter>
<suffix> ::= <prefix>.<domain>
<address> ::= <prefix>@<suffix>
The first line of the input file contains integer number N (1 <= N <= 100) -- the number of email addresses to be checked. Each of the following N lines contains one email address. Email address is the non-empty sequence of characters with ASCII codes from 32 to 255 no more then 100 characters long.
For each address from the input write a separate line with the word YES, if the email address is valid and NO if it is not.
|Author:||Ilya V. Elterman
|Resource:||ACM ICPC 2004-2005, NEERC, Southern Subregional Contest
|Date:||Saratov, October 7, 2004
|Server time: 2017-11-24 13:54:25||Online Contester Team © 2002 - 2016. All rights reserved.|