{"problem":{"name":"Popcount and XOR","description":{"content":"You are given non-negative integers $a$, $b$, and $C$. Determine if there is a pair of non-negative integers $(X, Y)$ that satisfies all of the following five conditions. If such a pair exists, print ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc347_d"},"statements":[{"statement_type":"Markdown","content":"You are given non-negative integers $a$, $b$, and $C$. Determine if there is a pair of non-negative integers $(X, Y)$ that satisfies all of the following five conditions. If such a pair exists, print one.\n\n*   $0 \\leq X < 2^{60}$\n*   $0 \\leq Y < 2^{60}$\n*   $\\operatorname{popcount}(X) = a$\n*   $\\operatorname{popcount}(Y) = b$\n*   $X \\oplus Y = C$\n\nHere, $\\oplus$ denotes the bitwise XOR.\nIf multiple pairs $(X, Y)$ satisfy the conditions, you may print any of them.\nWhat is popcount?For a non-negative integer $x$, the popcount of $x$ is the number of $1$s in the binary representation of $x$. More precisely, for a non-negative integer $x$ such that $\\displaystyle x=\\sum _ {i=0} ^ \\infty b _ i2 ^ i\\ (b _ i\\in\\lbrace0,1\\rbrace)$, we have $\\displaystyle\\operatorname{popcount}(x)=\\sum _ {i=0} ^ \\infty b _ i$.\nFor example, $13$ in binary is `1101`, so $\\operatorname{popcount}(13)=3$. What is bitwise XOR?For non-negative integers $x, y$, the bitwise exclusive OR $x \\oplus y$ is defined as follows.\n\n*   The $2^k$'s place $\\ (k\\geq0)$ in the binary representation of $x \\oplus y$ is $1$ if exactly one of the $2^k$'s places $\\ (k\\geq0)$ in the binary representations of $x$ and $y$ is $1$, and $0$ otherwise.\n\nFor example, $9$ and $3$ in binary are `1001` and `0011`, respectively, so $9 \\oplus 3 = 10$ (in binary, `1010`).\n\n## Constraints\n\n*   $0 \\leq a \\leq 60$\n*   $0 \\leq b \\leq 60$\n*   $0 \\leq C < 2^{60}$\n*   All input values are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$a$ $b$ $C$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc347_d","tags":[],"sample_group":[["3 4 7","28 27\n\nThe pair $(X, Y) = (28, 27)$ satisfies the conditions. Here, $X$ and $Y$ in binary are `11100` and `11011`, respectively.\n\n*   $X$ in binary is `11100`, so $\\operatorname{popcount}(X) = 3$.\n*   $Y$ in binary is `11011`, so $\\operatorname{popcount}(Y) = 4$.\n*   $X \\oplus Y$ in binary is `00111`, so $X \\oplus Y = 7$.\n\nIf multiple pairs of non-negative integers satisfy the conditions, you may print any of them, so printing `42 45`, for example, would also be accepted."],["34 56 998244353","\\-1\n\nNo pair of non-negative integers satisfies the conditions."],["39 47 530423800524412070","540431255696862041 10008854347644927\n\nNote that the values to be printed may not fit in $32$\\-bit integers."]],"created_at":"2026-03-03 11:01:14"}}