1311 Detect ID
Submit solution
Points:
100
Time limit:
1.0s
Memory limit:
32M
Problem types
Allowed languages
C, C++, Java, Python
Description
You know everyone is assigned an id when he is born in our country. It is an 18-digit or 16-digit string. It has something to do with your resident place, birthday and others. In some place, the id has the form: "YYYYMMDDCCCC"
YYYY are the year.
For males, MM is a two-digit number of the month, i.e., a number between 01 and 12, inclusive.
For females, MM is the number of the month increased by 50, i.e., a number between 51 and 62, inclusive.
DD is a two digit number of the day in the month.
CCCC are four arbitrary digits that are used both as a checksum and as a way to distinguish between different people born on the same day.
The checksum property works as follows: the digits CCCC must be chosen in such a way that the entire 12-digit number is divisible by eleven (11).
Input
The input will be multiply cases. each case will be a 12-digit string as an id.
Output
Firstly, output the case order. Then if the id is valid output “Yes” else “No”
Sample
Input
198104121237
198134120005
200411131237
Output
Case 1: Yes
Case 2: No
Case 3: No
Source: BJL
Comments