11457 - Adding Decimals   

Description

Adding decimal (十進位制) numbers seems like a piece of cake for human beings. In this problem, 2 positive integers, A and B, are given, and you are asked to output the sum to these integers, and the number of carries while adding.

A carry happens when the result of the addition of certain digit is greater than 9. In that case, the higher digit will receive the additional 1 when adding. See the following case:

Carry     1     1 1 1
A           7 1 2 3 4 5
B           7 8 6 6 8 5 
      +)________________
Sum       1 4 9 9 0 3 0

So, the sum is 1499030 and the number of carries is 4.

Input

There are multiple test cases.

Each with 2 positive integers, A and B, are given in a line and separated by a space.

Case#1: 0<A, B<103

Case#2: 0<A, B<108

Case#3: 0<A, B<1016

Case#4: 0<A, B<101000

Output

Print the sum and number of carries in a line, and separate them with space. And print a new line ('\n') character at the end of your answer.

Sample Input  Download

Sample Output  Download

Tags




Discuss