{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"MD","content":"题目描述\n\n你现在有一个神奇的计算器,这种计算器被称为$x-y$计算器。\n\n因为是神奇计算器,所以它的操作也非常神奇。这个计算器的初始数值为$0$,然后你可以加一个数值$x$或$y$。当然,在这一步之前,你需要先输出当前数值的最后一位。\n\n这是$4-2$的一种情况:\n\n1. 输出$0$,然后加上$4$,当前数值为$4$,当前输出$0$。\n1. 输出$4$,然后加上$4$,当前数值为$8$,当前输出$04$。\n1. 输出$8$,然后加上$4$,当前数值为$12$,当前输出$048$。\n1. 输出$2$,然后加上$2$,当前数值为$14$,当前输出$0482$。\n1. 输出$4$,然后加上$4$,当前数值为$18$,当前输出$04824$。\n\n当然,这只是一种情况。如果我们每次都加$2$,还可以得到$0246802468024$这个序列。\n\n现在你有一个由$x-y$计算器得到的序列$s$,但是由于这个计算器为初代产品,某些数字丢失了。\n\n然而你想恢复这个序列,不过问题是你并不知道这是哪一款$x-y$计算器(即不知道$x$与$y$的大小),所以对于每一款$x-y(0≤x,y\u003c10)$计算器,输出使序列$s$变为能由该款计算器能得到的序列最小所需插入的数字数。\n\n输入格式\n\n仅一行,一个字符串$s$,$s$的长度小于$2⋅10^6$且均有数字$0$~$9$组成。\n\n输出格式\n\n一个$10×10$的矩阵,第$i$行第$j$个为使序列$s$变为能由$i-j$计算器能得到的序列最小所需插入的数字数。如果不能,则输出$-1$($i,j$皆从$0$开始编号)。\n\n"}},{"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\u003e0840\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e-1 17 7 7 7 -1 2 17 2 7 \n17 17 7 5 5 5 2 7 2 7 \n7 7 7 4 3 7 1 7 2 5 \n7 5 4 7 3 3 2 5 2 3 \n7 5 3 3 7 7 1 7 2 7 \n-1 5 7 3 7 -1 2 9 2 7 \n2 2 1 2 1 2 2 2 0 1 \n17 7 7 5 7 9 2 17 2 3 \n2 2 2 2 2 2 0 2 2 2 \n7 7 5 3 7 7 1 3 2 7 \n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"MD","content":"\u003cp\u003eLet\u0027s take, for example, $$$4$$$-$$$3$$$-counter. One of the possible outcomes the counter could print is $$$0(4)8(1)4(7)0$$$ (lost elements are in the brackets).\u003c/p\u003e\n\u003cp\u003eOne of the possible outcomes a $$$2$$$-$$$3$$$-counter could print is $$$0(35)8(1)4(7)0$$$.\u003c/p\u003e\n\u003cp\u003eThe $$$6$$$-$$$8$$$-counter could print exactly the string $$$0840$$$.\u003c/p\u003e"}}]}