*Problem*

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.


*Input*
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.

*Output*
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. (See "What if a test case has 
multiple correct solutions?" in the Competing section of the FAQ. This 
information about multiple solutions will not be explicitly stated in the 
remainder of the 2019 contest.)



*Here is the full problem:*
https://codingcompetitions.withgoogle.com/codejam/round/0000000000051705/0000000000088231

*My solution:*





















*import redef missing_number(k, N):    if not (1 < int(N) < 10**100) or '4' 
not in N:        print()        return    pos = [i.start(0) for i in 
re.finditer('4', N)]    inter_list = [i for i in N]    for i in pos:        
inter_list[i] = '3'    val = int(''.join(inter_list))    diff = int(N) - 
val    print(f'Case #{k+1}:', diff, val)t = int(input())l = []for i in 
range(t):    l.append(input())for t, N in enumerate(l):    
missing_number(t, N)*
*Output*(on my system
*)*







*34  9404444Case #1: 1 3Case #2: 10 930Case #3: 1111 3333Two questions:*
1. Will Code Jam allow importing of modules like *re, numpy, pandas, 
itertools*?
2. If yes, why does my code end up in Runtime Error (RE) (I've tried with 
60 digit number and works instantly in my system)?

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/f7416675-863d-449c-8621-e15908acf054%40googlegroups.com.

Reply via email to