{"trustable":false,"sections":[{"title":"Problem Statement","value":{"format":"MD","content":"Cynthia bought a new password lock for her cool electric bike. However, she was too busy solving algorithm problems so she forgot the password.\n\nCynthia likes math. She remembers that she set the password to the maximum XOR value of two integers in the range $[L, R]$. More formally, let $a$ and $b$ be two integers such that $L \\le a \\le b \\le R$. Cynthia\u0027s password is the maximum possible $a \\oplus b$, where $\\oplus$ is the bitwise XOR operation.\n\nCan you write an algorithm to determine the password?"}},{"title":"Input","value":{"format":"MD","content":"The first line is the integer $L$. The second line is the integer $R$."}},{"title":"Output","value":{"format":"MD","content":"Output the maximum bitwise-XOR value of two numbers, $a$ and $b$, such that $L \\le a \\le b \\le R$."}},{"title":"Constraints","value":{"format":"MD","content":"* $0 \\le L \\le R \\le 10^3$"}},{"title":"Sample 1","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e114\n514\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1023\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"Explanation 1","value":{"format":"MD","content":"The $a$ and $b$ that will trigger the maximum value could be $a\u003d509$ and $b\u003d514$. Since $a \\oplus b \u003d 509 \\oplus 514 \u003d 1023$, we output 1023."}},{"title":"Sample 2","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e0\n0\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"Explanation 2","value":{"format":"MD","content":"There is only one number in the range $[0, 0]$, which is $0$. Since $0 \\oplus 0 \u003d 0$, we output 0."}}]}