Addition Without Carry

View as PDF

Submit solution

Points: 5 (partial)
Time limit: 5.0s
Memory limit: 256M

Author:
Problem type

Usually, when addition is performed, each carry is added onto the next digit in the number. For example, 18 + 17 = 35, as the carry from 8 + 7 is added onto 1 + 1. If we perform addition without carry, the answer would have been 25, as the carry from 7+8 is discarded.

Given two large numbers, can you perform addition without carry?

Input Specification

The first line will contain T (1 \le T \le 10), the number of test cases. T cases follow.

For each case, there will be a single line consisting of two space-separated integers, a, b (1 \le a, b \le 10^{100000}), for which you are to perform addition without carry on.

Output Specification

For each test case, output the answer on its own line.

Sample Input

2
17 18
111111111111111111111 999999999999999999999

Sample Output

25
0

Comments

There are no comments at the moment.