P6123 [NEERC 2016] Hard Refactoring
Description
For a variable $x$, some constraints are given in the form $x \ge a$ or $x \le a$. These constraints are connected using ```||```, and you need to simplify them and finally output the simplified constraints.
Input Format
The input has at most $10^3$ lines. Each line is either two constraints connected by ```&&``` or a single constraint.
If a line has two constraints, the first constraint is always in the form $x \ge a$, and the second constraint is always in the form $x \le a$.
Except for the last line of the input, each line ends with a ```||```.
All characters (except `>=`, `
Output Format
Output several lines representing the simplest form of the constraints (that is, make the number of output lines as small as possible). The other formatting should remain the same as in the input format.
The output lines do not need to be in any particular order.
In particular, if for any $x \in [-32768, 32767]$, $x$ can satisfy the constraints, output only one line: ```true```. Otherwise, if for any $x \in [-32768, 32767]$, $x$ cannot satisfy the constraints, output only one line: ```false```.
Explanation/Hint
For all numbers that appear in this problem (including $x$), they are all $\ge -32768$ ($-2^{15}$) and $\le 32767$ ($2^{15}-1$).
Translated by ChatGPT 5