Problem:
National Budget

A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647.

Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.

If given integers or the sum have more than 80 digits, print "overflow".

Input

Input consists of several datasets. In the first line, the number of datasets N (1 ≤ N ≤ 50) is given. Each dataset consists of 2 lines:

The first integer
The second integer

The integer has at most 100 digits.

Output

For each dataset, print the sum of given integers in a line.

Sample Input

6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000

Output for the Sample Input

1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow

Solution in C# (judge verdict: Accepted)

using System;
using System.Linq;

namespace Volume0_0015
{
    class Program
    {
        static void Main(string[] args)
        {
            var count = Convert.ToInt32(Console.ReadLine());
            for(var i = 0; i < count; i++)
            {
                var num1 = new BigInteger(Console.ReadLine());
                var num2 = new BigInteger(Console.ReadLine());
                var ans = num1 + num2;
                Console.WriteLine(ans.Digit > 80 ? "overflow" : ans.ToString());
            }
        }
    }

    // atama warui
    public class BigInteger
    {
        public const int maxDigit = 8;

        public int Digit
        {
            get
            {
                if (Next == null) return Number.ToString().Length;
                return Next.Digit + Number.ToString().Length;
            }
        }

        string Number;
        BigInteger Next = null;

        public BigInteger(string num)
        {
            Number = new string(num.Skip(num.Length - maxDigit).ToArray());
            var remain = new string(num.Take(num.Length - maxDigit).ToArray());
            if (remain.Length != 0) Next = new BigInteger(remain);
        }
        
        public static BigInteger operator +(BigInteger a, BigInteger b)
        {
            return Add(a, b);
        }      

        public static BigInteger Add(BigInteger a, BigInteger b, BigInteger newInt = null)
        {
            if (a == null && b == null && newInt == null) return null;
            else if (a == null && b == null) return newInt;
            else if (a != null && b == null)
            {
                if (newInt == null) newInt = new BigInteger("0");
                newInt.Number = (Convert.ToInt32(a.Number) + Convert.ToInt32(newInt.Number)).ToString("D8");
                CheckCarry(newInt);
                newInt.Next = Add(a.Next, null, newInt.Next);
            }
            else if (a == null && b != null)
            {
                if (newInt == null) newInt = new BigInteger("0");
                newInt.Number = (Convert.ToInt32(b.Number) + Convert.ToInt32(newInt.Number) ).ToString("D8");
                CheckCarry(newInt);
                newInt.Next = Add(null, b.Next, newInt.Next);
            }
            else
            {
                if (newInt == null) newInt = new BigInteger("0");
                newInt.Number = (Convert.ToInt32(a.Number) + Convert.ToInt32(b.Number) + Convert.ToInt32(newInt.Number)).ToString("D8");
                CheckCarry(newInt);
                newInt.Next = Add(a.Next, b.Next, newInt.Next);
            }
            if (newInt.Next == null)
            {
                for (var i = 0; i < maxDigit - 1; i++)
                {
                    if (newInt.Number[0] != '0') break;
                    newInt.Number = new string(newInt.Number.Skip(1).ToArray());
                }
            }
            return newInt;
        }

        protected static void CheckCarry(BigInteger bigint)
        {
            if (bigint.ToString().Length > maxDigit)
            {
                bigint.Number = new string(bigint.Number.Skip(1).ToArray());
                bigint.Next = new BigInteger("1");
            }
        }

        public override string ToString()
        {
            if (Next == null) return Number.ToString();
            else return Next.ToString() + Number;
        }
    }
}