logo AlgoBeat OnlineJudge
登录 注册

#214721. [NWRRC 2025] Faulty Fraction

内存限制:1024 MiB 时间限制:2000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

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 by a positive integer . The result was a positive integer , since was divisible by . Felix wrote in his notebook and went outside to play football.

His 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 sign from the equation. As a result, the left-hand side of the equation became a single string of digits .

Once Felix came back, he saw in his notebook. Unfortunately, he forgot the original values of and~. Now he needs to split back into two parts using the sign to restore a correct division equation.

Help Felix find positive integers and such that is the concatenation of the decimal representations of and , and .

输入格式

The only line contains a string of digits and an integer . Both and consist of at least and at most digits and do not have leading zeros.

It is guaranteed that is a concatenation of two positive integers and written without leading zeros such that .

输出格式

Print two positive integers and without leading zeros such that is the concatenation of and , and . If there are multiple answers, print any of them.

样例

样例输入 1

42 2

样例输出 1

4 2

样例输入 2

2025225 9

样例输出 2

2025 225

样例输入 3

239239239 1001

样例输出 3

239239 239