아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Foregone Solution

면접 대비

시간 제한10초메모리 제한1024 MB

요약
적어도 한 자리에 4가 들어 있는 N을, 4를 포함하지 않는 두 양의 정수 A, B로 나누어 A + B = N이 되게 한다.
난이도

보통10점 중 4점

유형
수학, 구현, 그리디, 완전 탐색
정답자
아직 제출이 없습니다

문제

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.

힌트

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

예제1

  1. 예제 1

    입력
    3
    4
    940
    4444
    
    예상 출력
    Case #1: 2 2
    Case #2: 852 88
    Case #3: 667 3777