P6382 "MdOI R2" Car
Description
In MdOI City, to promote environmental protection, some vehicles are restricted from entering the urban area, called “traffic restriction” for short. Whether a car is restricted depends on its license plate number and the date.
The license plate is encoded as follows:
- The first three characters are all uppercase letters, indicating the region.
- The last five characters are uppercase letters or digits, serving as the identifier code. **It is guaranteed that there is at least one digit.**
- The last digit of the plate is the first digit when scanning from right to left.
In this problem’s encoding, the first three characters for MdOI City are `MDA`. For example, a car in MdOI City with identifier code `6780P` has the plate `MDA6780P`, and its last digit is $0$.
In MdOI City, the traffic restriction rules are:
1. For non-local cars (i.e., the first three characters are not `MDA`), they are restricted on all weekdays (Monday to Friday).
2. For other local cars, certain last digits are restricted each day. The restricted last digits from Monday to Friday are as follows:
| Date | Monday | Tuesday | Wednesday | Thursday | Friday |
| :------: | :--------: | :---------: | :-----------: | :----------: | :--------: |
| Restricted last digit | $1$ and $9$ | $2$ and $8$ | $3$ and $7$ | $4$ and $6$ | $5$ and $0$ |
Xiao C tells you her license plate number. She wants to know on which weekdays from Monday to Friday her car will be restricted. Please help her.
Input Format
One line containing a string of length $8$, representing Xiao C’s license plate number.
Output Format
Output $5$ digits. Each digit is $0$ or $1$, indicating whether Xiao C’s car is restricted from Monday to Friday, respectively. $1$ means restricted, and $0$ means not restricted.
Explanation/Hint
【Help and Hints】
To make it easier for contestants to debug their code, this problem additionally provides three groups of samples. Since the samples are small, they are placed in one clipboard.
[Additional samples](https://www.luogu.com.cn/paste/g8pxrrh3)
---
【Sample Explanation】
For Sample 1, the first three characters of the license plate are `MDA`, so it is a local plate. The last digit is $6$, so it is restricted on Thursday.
For Sample 2, the first three characters of the license plate are `ZJO`, which is a non-local plate, so it is restricted from Monday to Friday.
---
【Constraints】
**This problem uses bundled tests, meaning you can get the score for a subtask only if you pass all test points in that subtask.**
|Subtask ID|Special property|Score|
|:-:|:-:|:-:|
|Subtask 1|The first $3$ characters are not `MDA`|$30$|
|Subtask 2|The last character is definitely a digit|$30$|
|Subtask 3|None|$40$|
For all testdata, the first three characters are guaranteed to be uppercase letters. The last five characters may include uppercase letters or digits, and there is at least one digit.
Translated by ChatGPT 5