#P5710. 【深基3.例2】数的性质
【深基3.例2】数的性质
Properties of a Number
Problem Source
Luogu P5710
Problem Description
Some integers may have the following properties:
- Property 1: it is even;
- Property 2: it is greater than 4 and not greater than 12.
Xiao A likes integers for which both properties hold; Uim likes integers for which at least one of the properties holds; Xiao B likes integers for which exactly one of the properties holds; Zhengmei likes integers for which neither property holds. Now given an integer x, tell whether each of them likes this integer.
Input Format
Input an integer x (0 ≤ x ≤ 1000).
Output Format
Output whether each of the 4 people likes this number: if they like it output 1, otherwise output 0, separated by spaces. The output order is: Xiao A, Uim, Xiao B, Zhengmei.
Sample Input
12
Sample Output
1 1 0 0
Hint
- The two "properties" are two true/false conditions: one about parity, one about an interval. Compute these two boolean values first.
- The four people's tastes are four different logical combinations — how do you write "and", "or", "exactly one holds", "neither holds"?
- "Exactly one holds" has no ready-made operator; think about which relation between the two boolean values makes it true.
- Check against the sample: 12 → 1 1 0 0.