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

27770번 - Foregone Solution 서브태스크스페셜 저지다국어채점 준비 중

시간 제한메모리 제한제출정답맞힌 사람정답 비율
10 초 (추가 시간 없음) 1024 MB0000.000%

문제

Someone just won the Code Jam lottery, and we owe them N jamcoins! However, when we tried to print out an oversized check, we encountered a problem. The value of N, which is an integer, includes at least one digit that is a 4... and the 4 key on the keyboard of our oversized check printer is broken.

Fortunately, we have a workaround: we will send our winner two checks for positive integer amounts A and B, such that neither A nor B contains any digit that is a 4, and A + B = N. Please help us find any pair of values A and B that satisfy these conditions.

입력

The first line of the input gives the number of test cases, T. T test cases follow; each consists of one line with an integer N.

출력

For each test case, output one line containing Case #x: A B, where x is the test case number (starting from 1), and A and B are positive integers as described above.

It is guaranteed that at least one solution exists. If there are multiple solutions, you may output any one of them.

제한

  • 1 ≤ T ≤ 100.
  • At least one of the digits of N is a 4.

Test Set 1 (6점)

  • 1 < N < 105.

Test Set 2 (10점)

  • 1 < N < 109.

Test Set 3 (1점)

  • 1 < N < 10100.

예제 입력 1

3
4
940
4444

예제 출력 1

Case #1: 2 2
Case #2: 852 88
Case #3: 667 3777

힌트

In Sample Case #1, notice that A and B can be the same. The only other possible answers are 1 3 and 3 1.

출처

Contest > Google > Code Jam > Google Code Jam 2019 > Qualification Round A번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

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

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