{"extraResources":{"example.01.mu":"TVXzATQyIDINCg==","example.02.mu":"TVXzATIwMjUyMjUgOQ0K","example.03.mu":"TVXzATIzOTIzOTIzOSAxMDAxDQo="},"scoring":null,"notes":"","legend":"Felix is studying basic arithmetic at school. Today he learned division. As a final task, he calculated the result of the division of a positive integer $a$ by a positive integer $b$. The result was a positive integer $c$, since $a$ was divisible by $b$. Felix wrote $a \\div b = c$ in his notebook and went outside to play football.\r\n\r\nHis little sister Fiona had been watching his studies with great interest. When Felix left, she decided to play a little trick on him: she took his notebook and erased the `$\\div$' sign from the equation. As a result, the left-hand side of the equation became a single string of digits $s$.\r\n\r\nOnce Felix came back, he saw $s = c$ in his notebook. Unfortunately, he forgot the original values of $a$ and~$b$. Now he needs to split $s$ back into two parts using the `$\\div$' sign to restore a correct division equation.\r\n\r\nHelp Felix find positive integers $a$ and $b$ such that $s$ is the concatenation of the decimal representations of $a$ and~$b$, and $a \\div b = c$.","authorLogin":"tourist","language":"english","timeLimit":2000,"output":"Print two positive integers $a$ and $b$ without leading zeros such that $s$ is the concatenation of $a$ and $b$, and $a \\div b = c$. If there are multiple answers, print any of them.","inputFile":"stdin","outputFile":"stdout","input":"The only line contains a string of digits $s$ and an integer $c$. Both $s$ and $c$ consist of at least $1$ and at most $10^5$ digits and do not have leading zeros.\r\n\r\nIt is guaranteed that $s$ is a concatenation of two positive integers $a$ and $b$ written without leading zeros such that $a \\div b = c$.","authorName":"Gennady Korotkevich","sampleTests":[{"output":"4 2\r\n","input":"42 2\r\n","inputFile":"example.01","outputFile":"example.01.a"},{"output":"2025 225\r\n","input":"2025225 9\r\n","inputFile":"example.02","outputFile":"example.02.a"},{"output":"239239 239\r\n","input":"239239239 1001\r\n","inputFile":"example.03","outputFile":"example.03.a"}],"name":"Faulty Fraction","interaction":null,"memoryLimit":1073741824,"tutorial":"{\r\n    \\parindent=1cm\r\n    \\begin{tabular}{l@{\\extracolsep{1cm}}l}\r\n         Идея: & Николай Дубчук\\\\\r\n         Разработка: & Николай Будин\\\\\r\n     \\end{tabular}\r\n}\r\n\r\nВам дана строка из цифр $s$ и целое число $c$. Известно, что существуют два целых положительных числа $a$ и $b$, такие что $a \\div b = c$ и $concat(a, b) = s$. Требуется найти любые подходящие $a$ и $b$.\r\n\r\nОбозначим за $l(x)$ длину числа $x$. Тогда $10^{l(x) - 1} \\le x < 10^{l(x)}$.\r\n\r\n\\begin{align*}\r\n& \\begin{cases}\r\n10^{l(b) - 1} \\le b < 10^{l(b)}\\\\\r\n10^{l(c) - 1} \\le c < 10^{l(c)}\\\\\r\n\\end{cases}\r\n\\implies \\\\[1em]\r\n\\implies & 10^{l(b) + l(c) - 2} \\le b \\cdot c < 10^{l(b) + l(c)} \\implies \\\\[1em]\r\n\\implies & l(b) + l(c) - 1 \\le l(b \\cdot c) \\le l(b) + l(c);\\\\[1.5em]\r\n& a \\div b = c \\implies a = b \\cdot c \\implies l(a) = l(b \\cdot c) \\implies\\\\[1em]\r\n\\implies & l(b) + l(c) - 1 \\le l(a) \\le l(b) + l(c) \\implies \\\\[1em]\r\n\\implies & (l(s) - l(a)) + l(c) - 1 \\le l(a) \\le (l(s) - l(a)) + l(c) \\implies \\\\[1em]\r\n\\implies & l(s) + l(c) - 1 \\le 2 \\cdot l(a) \\le l(s) + l(c)\r\n\\end{align*}\r\n\r\nЗаметим, что $2 \\cdot l(a)$~--- четное, поэтому оно может быть равно только одному из двух последовательных значений $l(s) + l(c) - 1$ и $l(s) + l(c)$. Таким образом, $l(a) = \\lfloor \\frac{l(s) + l(c)}{2}\\rfloor$. Решение единственно. А раз нам гарантируется, что такие $a$ и $b$ должны существовать, это именно они."}