Program one;
Type Vek=Array[1..1000000] Of Integer;
Var v:Vek;
    n,a,b,i,t,j,x,aux,anz,auy,auz:Integer;
    Gef1,Gef2,Gef:Boolean;
Begin
    Readln(t);
    For x:=1 to t Do
    Begin
        Readln(n);
        a:=n Div 2;
        b:=n-a;
        Repeat
        Gef:=True;
            Repeat
                auy:=a;
                Gef1:=True;
                While auy<>0 Do
                    Begin
                        If auy Mod 10=4 Then Gef1:=False;
                        auy:=auy Div 10;
                    End;
                If not Gef1 Then
                    a:=a Div 2;
            Until Gef1;
        b:=n-a;
            Repeat
                auz:=b;
                Gef2:=True;
                While auz<>0 Do
                    Begin
                        If auz Mod 10=4 Then Gef2:=False;
                        auz:=auz Div 10;
                    End;
                If not Gef2 Then
                    b:=b Div 2;
            Until Gef2;
        a:=n-b;
            auy:=a;
            Gef:=True;
            While auy<>0 Do
            Begin
                If auy Mod 10 = 4 Then Gef:=False;
                auy:=auy Div 10;
            End;
        Until Gef;
        Write('Case #',x,': ',A,' ',B);
        Writeln;
    End;
    Readln;
End.

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/06100684-8db5-487b-b7e3-08dce98dfa99%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to