Ali and Helping innocent people
Practice
3.7 (488 votes)
Basic programming
Easy
Input/output
Problem
92% Success 198718 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code
Arpasland has surrounded by attackers. A truck enters the city. The driver claims the load is food and medicine from Iranians. Ali is one of the soldiers in Arpasland. He doubts about the truck, maybe it's from the siege. He knows that a tag is valid if the sum of every two consecutive digits of it is even and its letter is not a vowel. Determine if the tag of the truck is valid or not.
We consider the letters "A","E","I","O","U","Y" to be vowels for this problem.
Input Format
The first line contains a string of length 9. The format is "DDXDDD-DD", where D stands for a digit (non zero) and X is an uppercase english letter.
Output Format
Print "valid" (without quotes) if the tag is valid, print "invalid" otherwise (without quotes)
Submissions
Please login to view your submissions
Similar Problems
Points:20
342 votes
Tags:
Ad-HocBasic ProgrammingEasyInput/Output
Points:30
18 votes
Tags:
AlgorithmsApprovedBreadth First SearchGraphsMediumOpen
Points:20
54 votes
Tags:
ApprovedBinary SearchData StructuresEasyImplementationOpenSorting
Editorial