{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv id\u003d\"yass_top_edge_dummy\" style\u003d\"width: 1px; height: 1px; padding: 0px; margin: -9px 0px 0px; border-width: 0px; display: block;\"\u003e\r\n\t\u0026nbsp;\u003c/div\u003e\r\n\u003cdiv id\u003d\"yass_top_edge\" style\u003d\"background-image: url(\u0026quot;chrome://yass/content/edgebgtop.png\u0026quot;); background-attachment: scroll; background-position: center bottom; padding: 0px; margin: 0px 0px 8px -8px; border-width: 0px; height: 0px; display: block; width: 1px;\"\u003e\r\n\t\u0026nbsp;\u003c/div\u003e\r\n\u003cp\u003e\r\n\tWhen a number is expressed in decimal, the \u003cspan data-scayt_word\u003d\"k-th\" data-scaytid\u003d\"1\"\u003e\u003ci\u003ek\u003c/i\u003e-th\u003c/span\u003e digit represents a multiple of \u003cspan data-scayt_word\u003d\"10k\" data-scaytid\u003d\"2\"\u003e10\u003csup\u003e\u003ci\u003ek\u003c/i\u003e\u003c/sup\u003e\u003c/span\u003e. (Digits are numbered from right to left, where the least significant digit is number 0.) For example,\u003c/p\u003e\r\n\u003cdiv align\u003d\"CENTER\"\u003e\r\n\u003c!-- MATH: \\begin{displaymath}\r\n81307_{10} \u003d 8 \\times 10^4 + 1 \\times 10^3 + 3 \\times 10^2 + 0 \\times 10^1 +\r\n7 \\times 10 0 \u003d 80000 + 1000 + 300 + 0 + 7\r\n\u003d 81307.\r\n\\end{displaymath} --\u003e\t\u003cimg alt\u003d\"\\begin{displaymath}81307_{10} \u003d 8 \\times 10^4 + 1 \\times 10^3 + 3 \\times 10^2 + ...\r\n...mes 10^1 +\r\n7 \\times 10 0 \u003d 80000 + 1000 + 300 + 0 + 7\r\n\u003d 81307.\r\n\\end{displaymath}\" height\u003d\"29\" src\u003d\"http://uva.onlinejudge.org/external/5/575img1.gif\" width\u003d\"641\" /\u003e\u003c/div\u003e\r\n\u003cp\u003e\r\n\tWhen a number is expressed in binary, the \u003cspan data-scayt_word\u003d\"k-th\" data-scaytid\u003d\"3\"\u003e\u003ci\u003ek\u003c/i\u003e-th\u003c/span\u003e digit represents a multiple of \u003cspan data-scayt_word\u003d\"2k\" data-scaytid\u003d\"6\"\u003e2\u003csup\u003e\u003ci\u003ek\u003c/i\u003e\u003c/sup\u003e\u003c/span\u003e. For example,\u003c/p\u003e\r\n\u003cdiv align\u003d\"CENTER\"\u003e\r\n\u003c!-- MATH: \\begin{displaymath}\r\n10011_2 \u003d 1 \\times 2^4 + 0 \\times 2^3 + 0 \\times 2^2 + 1 \\times 2^1 +\r\n1 \\times 2^0 \u003d 16 + 0 + 0 + 2 + 1 \u003d 19.\r\n\\end{displaymath} --\u003e\t\u003cimg alt\u003d\"\\begin{displaymath}10011_2 \u003d 1 \\times 2^4 + 0 \\times 2^3 + 0 \\times 2^2 + 1 \\times 2^1 +\r\n1 \\times 2^0 \u003d 16 + 0 + 0 + 2 + 1 \u003d 19.\r\n\\end{displaymath}\" height\u003d\"29\" src\u003d\"http://uva.onlinejudge.org/external/5/575img2.gif\" width\u003d\"553\" /\u003e\u003c/div\u003e\r\n\u003cp\u003e\r\n\tIn \u003cb\u003eskew binary\u003c/b\u003e, the \u003cspan data-scayt_word\u003d\"k-th\" data-scaytid\u003d\"4\"\u003e\u003ci\u003ek\u003c/i\u003e-th\u003c/span\u003e digit represents a multiple of \u003c!-- MATH: $2^{k+1} - 1$ --\u003e\u003cspan data-scayt_word\u003d\"2k\" data-scaytid\u003d\"8\"\u003e2\u003csup\u003e\u003ci\u003ek\u003c/i\u003e\u003c/sup\u003e\u003c/span\u003e\u003csup\u003e+1\u003c/sup\u003e - 1. The only possible digits are 0 and 1, except that the least-significant nonzero digit can be a 2. For example,\u003c/p\u003e\r\n\u003cdiv align\u003d\"CENTER\"\u003e\r\n\u003c!-- MATH: \\begin{displaymath}\r\n10120_{skew} \u003d 1 \\times (2^5 - 1) + 0 \\times (2^4-1) + 1 \\times (2^3-1) +\r\n2 \\times (2^2-1) + 0 \\times (2^1-1)\r\n\u003d 31 + 0 + 7 + 6 + 0 \u003d 44.\r\n\\end{displaymath} --\u003e\t\u003cimg alt\u003d\"\\begin{displaymath}10120_{skew} \u003d 1 \\times (2^5 - 1) + 0 \\times (2^4-1) + 1 \\tim...\r\n...2 \\times (2^2-1) + 0 \\times (2^1-1)\r\n\u003d 31 + 0 + 7 + 6 + 0 \u003d 44.\r\n\\end{displaymath}\" height\u003d\"31\" src\u003d\"http://uva.onlinejudge.org/external/5/575img3.gif\" width\u003d\"696\" /\u003e\u003c/div\u003e\r\n\u003cp\u003e\r\n\tThe first 10 numbers in skew binary are 0, 1, 2, 10, 11, 12, 20, 100, 101, and 102. (Skew binary is useful in some applications because it is possible to add 1 with at most one carry. However, this has nothing to do with the current problem.)\u003c/p\u003e\r\n\u003ch2\u003e\r\n\t\u003cfont color\u003d\"#0070E8\"\u003e\u003ca name\u003d\"SECTION0001001000000000000000\"\u003e Input\u003c/a\u003e\u0026nbsp;\u003c/font\u003e\u003c/h2\u003e\r\n\u003cp\u003e\r\n\tThe input file contains one or more lines, each of which contains an integer \u003ci\u003en\u003c/i\u003e. If \u003ci\u003en\u003c/i\u003e \u003d 0 it signals the end of the input, and otherwise \u003ci\u003en\u003c/i\u003e is a nonnegative integer in skew binary.\u003c/p\u003e\r\n\u003ch2\u003e\r\n\t\u003cfont color\u003d\"#0070E8\"\u003e\u003ca name\u003d\"SECTION0001002000000000000000\"\u003e Output\u003c/a\u003e\u0026nbsp;\u003c/font\u003e\u003c/h2\u003e\r\n\u003cp\u003e\r\n\tFor each number, output the decimal equivalent. The decimal value of \u003ci\u003en\u003c/i\u003e will be at most \u003c!-- MATH: $2^{31} - 1 \u003d 2147483647$ --\u003e2\u003csup\u003e31\u003c/sup\u003e - 1 \u003d 2147483647.\u003c/p\u003e\r\n\u003ch2\u003e\r\n\t\u003cfont color\u003d\"#0070E8\"\u003e\u003ca name\u003d\"SECTION0001003000000000000000\"\u003e Sample Input\u003c/a\u003e\u0026nbsp;\u003c/font\u003e\u003c/h2\u003e\r\n\u003cpre\u003e\r\n10120\r\n200000000000000000000000000000\r\n10\r\n1000000000000000000000000000000\r\n11\r\n100\r\n11111000001110000101101102000\r\n0\r\n\u003c/pre\u003e\r\n\u003ch2\u003e\r\n\t\u003cfont color\u003d\"#0070E8\"\u003e\u003ca name\u003d\"SECTION0001004000000000000000\"\u003e Sample Output\u003c/a\u003e\u0026nbsp;\u003c/font\u003e\u003c/h2\u003e\r\n\u003cpre\u003e\r\n44\r\n2147483646\r\n3\r\n2147483647\r\n4\r\n7\r\n1041110737\r\n\u003c/pre\u003e\r\n\u003chr /\u003e"}}]}