Logo
(追記) (追記ここまで)

35023번 - Faulty Fraction 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 2048 MB27161456.000%

문제

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.

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

Once 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.

Help 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$.

입력

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.

It is guaranteed that $s$ is a concatenation of two positive integers $a$ and $b$ written without leading zeros such that $a \div b = c$.

출력

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.

제한

예제 입력 1

42 2

예제 출력 1

4 2

예제 입력 2

2025225 9

예제 출력 2

2025 225

예제 입력 3

239239239 1001

예제 출력 3

239239 239

노트

출처

ICPC > Regionals > Northern Eurasia > Northwestern Russia Regional Contest > ICPC 2025-2026 Northwestern Russia Regional Contest F번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /