Don't neglect the warm-up.
The brain is also a muscle, and it cannot be used without a warm-up, so we offer you a warm-up task (even without any legend).
You are given three integers , , and , and the equation system:
Here, means the bitwise OR operation.
First, you need to calculate the number of non-negative roots for this system of equations. In other words, you need to find the number of distinct pairs (\alpha, \beta) such that \alpha + \beta = a and \alpha\,|\,\beta = b. Please note that (\alpha, \beta) and (\beta, \alpha) are considered as distinct pairs (if \alpha \ne \beta).
Second, you need to find the smallest possible distance between and (i.e., the smallest possible value of |\alpha - \beta| among all the roots) or if there are no roots.
If g = 0, then you have to output just the first answer. Otherwise, you need to output both answers.
The first and only line contains three integers , , (1 \le a, b \le 10^{18}, 0 \le g \le 1).
In the first line, output the number of non-negative roots for this equation system.
If g = 1, then in the second line output the smallest distance between and , or if no solution exists. Otherwise, do not output anything in the second line.
Example
Example 1
Example 2
( points): a = b;
( points): a \le 10^3, g = 0;
( points): a \le 10^3;
( points): a \le 10^6, g = 0;
( points): a \le 10^6;
( points): a \le 10^{18}, g = 0;
( points): no additional constraints.