{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n #problem-body \u003e pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003ctable border\u003d\"0\" class\u003d\"problems\" style\u003d\"width: 100%;\"\u003e\r\n\t\u003ctbody\u003e\r\n\t\t\u003ctr class\u003d\"navigation\"\u003e\r\n\t\t\t\u003ctd width\u003d\"50%\"\u003e\r\n\t\t\t\t\u003ca href\u003d\"/problems/MBIPALIN/en/\"\u003eEnglish\u003c/a\u003e\u003c/td\u003e\r\n\t\t\t\u003ctd width\u003d\"50%\"\u003e\r\n\t\t\t\t\u003ca href\u003d\"/problems/MBIPALIN/vn/\"\u003eVietnamese\u003c/a\u003e\u003c/td\u003e\r\n\t\t\u003c/tr\u003e\r\n\t\u003c/tbody\u003e\r\n\u003c/table\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u003cspan data-scayt_word\u003d\"Pero\" data-scaytid\u003d\"1\"\u003ePero\u003c/span\u003e and \u003cspan data-scayt_word\u003d\"Slavko\" data-scaytid\u003d\"5\"\u003eSlavko\u003c/span\u003e are two students who love math. \u003cspan data-scayt_word\u003d\"Pero\" data-scaytid\u003d\"2\"\u003ePero\u003c/span\u003e is very creative and often comes up with new ideas. \u003cspan data-scayt_word\u003d\"Slavko\" data-scaytid\u003d\"6\"\u003eSlavko\u003c/span\u003e later spends days thinking about \u003cspan data-scayt_word\u003d\"Pero\u0027s\" data-scaytid\u003d\"9\"\u003ePero\u0026#39;s\u003c/span\u003e ideas. One day \u003cspan data-scayt_word\u003d\"Pero\" data-scaytid\u003d\"3\"\u003ePero\u003c/span\u003e and \u003cspan data-scayt_word\u003d\"Slavko\" data-scaytid\u003d\"7\"\u003eSlavko\u003c/span\u003e learned what a palindrome was: a string read the same in either direction (for example, \u0026quot;ANA\u0026quot;, \u0026quot;1991\u0026quot; and \u0026quot;RADAR\u0026quot; are palindromes). Later that day \u003cspan data-scayt_word\u003d\"Pero\" data-scaytid\u003d\"4\"\u003ePero\u003c/span\u003e came up with a new concept \u0026ndash; a \u003cspan data-scayt_word\u003d\"bipalindrome\" data-scaytid\u003d\"10\"\u003ebipalindrome\u003c/span\u003e (\u003cspan data-scayt_word\u003d\"bipalin\" data-scaytid\u003d\"11\"\u003ebipalin\u003c/span\u003e for short).\u003c/p\u003e\r\n\u003cp\u003e\r\n\tA \u003cspan data-scayt_word\u003d\"bipalin\" data-scaytid\u003d\"12\"\u003ebipalin\u003c/span\u003e is a number, composed of two palindromes of the same length. Both of these palindromes are strings of decimal digits, the first which may not start with the digit 0 (therefore, the entire \u003cspan data-scayt_word\u003d\"bipalin\" data-scaytid\u003d\"13\"\u003ebipalin\u003c/span\u003e may not start with a 0). For example, 393020 is a \u003cspan data-scayt_word\u003d\"bipalin\" data-scaytid\u003d\"14\"\u003ebipalin\u003c/span\u003e (composed of the palindromes 393 and 020), while 222 and 010202 are not.\u003c/p\u003e\r\n\u003cp\u003e\r\n\tAfter hearing about \u003cspan data-scayt_word\u003d\"bipalins\" data-scaytid\u003d\"17\"\u003ebipalins\u003c/span\u003e, \u003cspan data-scayt_word\u003d\"Slavko\" data-scaytid\u003d\"8\"\u003eSlavko\u003c/span\u003e started thinking. After half an hour he found that there is only one \u003cspan data-scayt_word\u003d\"bipalin\" data-scaytid\u003d\"15\"\u003ebipalin\u003c/span\u003e of length 6 that is divisible by 12345. This is the \u003cspan data-scayt_word\u003d\"bipalin\" data-scaytid\u003d\"16\"\u003ebipalin\u003c/span\u003e 555525. Shocked by this finding, he wants you to write a program that, given two integers N and M, calculates the number of different \u003cspan data-scayt_word\u003d\"bipalins\" data-scaytid\u003d\"18\"\u003ebipalins\u003c/span\u003e of length N that are divisible by M.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003cp\u003e\r\n\tInput consists of two integers N and M (2 \u0026le; N \u0026le; 20, 1 \u0026le; M \u0026le; 1 000 000), where N is even.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003cp\u003e\r\n\tOutput the number of different \u003cspan data-scayt_word\u003d\"bipalins\" data-scaytid\u003d\"19\"\u003ebipalins\u003c/span\u003e of length N that are divisible by M.\u003c/p\u003e"}},{"title":"Example","value":{"format":"HTML","content":"\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003ch3 style\u003d\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1.35em; \"\u003e\r\n\tSample\u003c/h3\u003e\r\n\u003cpre style\u003d\"margin-top: 5px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 10px; padding-right: 15px; padding-bottom: 10px; padding-left: 15px; border-left-width: 5px; border-left-style: solid; border-left-color: rgb(221, 218, 181); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(245, 243, 222); font: normal normal normal 1em/1.5 \u0027Courier News\u0027, monospace; background-position: initial initial; background-repeat: initial initial; \"\u003e\r\ninput \r\n6 123 \r\noutput \r\n71 \r\n\r\ninput \r\n2 10 \r\noutput \r\n9\r\n\r\ninput \r\n6 12345 \r\noutput \r\n1 \u003c/pre\u003e"}}]}