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



Sample input:
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000


Sample output:
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow

Submission status: Wrong Answer

Solution code:
# ?????¶??????????±???????????????°??????
import sys

def main():
    n = int(sys.stdin.readline().strip())

    for _ in range(n):
        x = int(sys.stdin.readline().strip())
        y = int(sys.stdin.readline().strip())
        print(x + y)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# ?????¶??????????±???????????????°??????
import sys

def main():
    n = int(sys.stdin.readline().strip())

    for _ in range(n):
        x = sys.stdin.readline().strip()
        y = sys.stdin.readline().strip()

        if len(x) > 80 or len(y) > 80:
            print('overflow')
        else:
            ans = int(x) + int(y)
            if len(str(ans)) > 80:
                print('overflow')
            else:
                print(x + y)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = input()
for i in range(n):
    a = input()
    b = input()
    sum = a + b
    if str(a) > 80 or str(b) > 80 or abs(sum) > 80:
        print 'overflow'
    else:
        print sum

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(n):
    x = input()
    y = input()
    if len(x) > 80 or len(y) > 80:
        print("overflow")
        continue
    s = ""
    rx = x[::-1]
    ry = y[::-1]
    lx = len(x)
    ly = len(y)
    if lx > ly:
        ml = lx
    else:
        ml = ly
    c = 0
    for j in range(ml + 1):
        x1 = 0
        y1 = 0
        if j < lx:
            x1 = int(rx[j])
        if j < ly:
            y1 = int(ry[j])
        c1 = x1 + y1 + c
        s += str(c1 % 10)
        c = c1 // 10

    rs = s[::-1]
    result = ""
    for j in range(len(rs)):
        if rs[j] != "0":
            result = rs[j:]
            break

    if len(result) > 80:
        print("overflow")
    else:
        print(result)

Submission status: Wrong Answer

Solution code:
times=int(input())
for i in range(times):
    a=int(input())
    b=int(input())
    if int((a+b)/(1e80))!=0:
        print("overflow")
    else: print(a+b)

Submission status: Wrong Answer

Solution code:
times=int(input())
for i in range(times):
    a=int(input())
    b=int(input())
    if int(a/1e80)!=0 or int(b/1e80)!=0 or int((a+b)/(1e80))!=0:
        print("overflow")
    else: print(a+b)

Submission status: Wrong Answer

Solution code:
times=int(input())
for i in range(times):
    a=int(input())
    b=int(input())
    if len(str(a))<80 or len(str(b))<80 or len(str(a+b))<80:
        print(a+b)
    else: print("overflow")

Submission status: Wrong Answer

Solution code:
times=int(input())
for i in range(times):
    a=int(input())
    b=int(input())
    if len(str(a))<80 and len(str(b))<80 and len(str(a+b))<80:
        print(a+b)
    else: print("overflow")

Submission status: Wrong Answer

Solution code:
upper = 10**80
n = int(input())
for i in range(n):
    n1 = int(input())
    if n1 >= upper:
        print("overflow")
        continue
    n2 = int(input())
    if n2 >= upper:
        print("overflow")
        continue
    print( n1 + n2 if n1+n2 < upper else "overflow")

Submission status: Wrong Answer

Solution code:
upper = 10**81
n = int(input())
for i in range(n):
    n1 = int(input())
    if n1 >= upper:
        print("overflow")
        continue
    n2 = int(input())
    if n2 >= upper:
        print("overflow")
        continue
    print( n1 + n2 if n1+n2 < upper else "overflow")

Submission status: Wrong Answer

Solution code:
upper = 10**81
n = int(input())
for i in range(n):
    n1 = int(input())
    n2 = int(input())
    if n1 >= upper or n2 >= upper:
        print("overflow")
        continue
    print( n1 + n2 if n1+n2 < upper else "overflow")

Submission status: Wrong Answer

Solution code:
n=int(input())
for _ in range(n):
    a=int(input())
    b=int(input())
    ab=a+b
    print(ab if ab<=10**80 else "overflow")

Submission status: Wrong Answer

Solution code:
n=int(input())
for _ in range(n):
    a=int(input())
    b=int(input())
    ab=a+b
    print(ab if ab<10**79 else "overflow")

Submission status: Wrong Answer

Solution code:
for _ in range(int(input())):
    a=int(input())+int(input())
    print([a,'overflow'][a>10**80])

Submission status: Wrong Answer

Solution code:
n=int(input())
for i in range(n):
    a=int(input())
    b=int(input())
    num=str(a+b)
    if len(num)>80:
        print("onerflow")
    else:
        print(num)

Submission status: Wrong Answer

Solution code:
import sys
N=int(input())
N=int(N/2)
for i in range(N):
    a=input()
    b=input()
    len_a=len(a)
    len_b=len(b)
    c=[]
    kuriage=0
    if(len_a>=len_b):
        for i in range(len_b):
            c.append((kuriage+int(a[len_a-1-i])+int(b[len_b-1-i]))%10)
            kuriage=(kuriage+int(a[len_a-1-i])+int(b[len_b-1-i]))//10
        for i in range(len_b,len_a):
            c.append((kuriage+int(a[len_a-1-i]))%10)
            kuriage=(kuriage+int(a[len_a-1-i]))//10



    else :
        for i in range(len_a):
            c.append((kuriage+int(a[len_a-1-i])+int(b[len_b-1-i]))%10)
            kuriage=(kuriage+int(a[len_a-1-i])+int(b[len_b-1-i]))//10
        for i in range(len_a,len_b):
            c.append((kuriage+int(b[len_b-1-i]))%10)
            kuriage=(kuriage+int(b[len_b-1-i]))//10

    if(kuriage==1):
        c.append(1)

    if(len(c)>=80):
        print('overflow')

    else:
        for i in c[::-1]:
            print(i,end='')
        print('')

Submission status: Wrong Answer

Solution code:
import sys
N=int(input())
for i in range(N):
    a=input()
    b=input()
    len_a=len(a)
    len_b=len(b)
    c=[]
    kuriage=0
    if(len_a>=len_b):
        for i in range(len_b):
            c.append((kuriage+int(a[len_a-1-i])+int(b[len_b-1-i]))%10)
            kuriage=(kuriage+int(a[len_a-1-i])+int(b[len_b-1-i]))//10
        for i in range(len_b,len_a):
            c.append((kuriage+int(a[len_a-1-i]))%10)
            kuriage=(kuriage+int(a[len_a-1-i]))//10



    else :
        for i in range(len_a):
            c.append((kuriage+int(a[len_a-1-i])+int(b[len_b-1-i]))%10)
            kuriage=(kuriage+int(a[len_a-1-i])+int(b[len_b-1-i]))//10
        for i in range(len_a,len_b):
            c.append((kuriage+int(b[len_b-1-i]))%10)
            kuriage=(kuriage+int(b[len_b-1-i]))//10

    if(kuriage==1):
        c.append(1)

    if(len(c)>=80):
        print('overflow')

    else:
        for i in c[::-1]:
            print(i,end='')
        print('')

Submission status: Wrong Answer

Solution code:
n = int(input())
for _ in range(n):
    a = input()
    b = input()
    m = max(len(a), len(b))
    if m > 80:
        print("overflow")
    a = list(reversed(a))
    b = list(reversed(b))
    t = 0
    ans = []
    for i in range(m):
        try:
            num_a = int(a[i])
        except:
            num_a = 0
        try:
            num_b = int(b[i])
        except:
            num_b = 0
        s = num_a + num_b + t
        if s >= 10:
            t = 1
            s -= 10
            ans.insert(0, s)
        else:
            ans.insert(0, s)
            t = 0
    if t == 1:
        ans.insert(0, 1)
    if len(ans) > 80:
        print("overflow")
    else:
        print(*ans, sep="")

Submission status: Wrong Answer

Solution code:
from decimal import Decimal


n = int(input())
for _ in range(n):
    a = Decimal(input())
    b = Decimal(input())
    s = a + b
    s = str(s)
    if len(s) > 80:
        print("overflow")
    else:
        print(s)

Submission status: Wrong Answer

Solution code:
from decimal import Decimal


n = int(input())
for _ in range(n):
    a = Decimal(input())
    b = Decimal(input())
    s = a + b
    s = str(s)
    if len(s) >= 80:
        print("overflow")
    else:
        print(s)

Submission status: Wrong Answer

Solution code:
from decimal import Decimal


n = int(input())
for _ in range(n):
    a = input()
    b = input()
    if max(len(a), len(b)) >= 80:
        print("overflow")
    s = Decimal(a) + Decimal(b)
    if len(str(s)) >= 80:
        print("overflow")
    else:
        print(s)

Submission status: Wrong Answer

Solution code:
from decimal import Decimal


n = int(input())
for _ in range(n):
    a = input()
    b = input()
    if max(len(a), len(b)) >= 80:
        print("overflow")
        continue
    s = Decimal(a) + Decimal(b)
    if len(str(s)) >= 80:
        print("overflow")
    else:
        print(s)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[]
B=[]
for i in range(N):
    a = int(input())
    b = int(input())
    A.append(a)
    B.append(b)

for i in range(N):
    if A[i] >= 10 ** 79 or B[i] >= 10 ** 79:
        print("overflow")
    elif A[i] + B[i]>= 10 ** 79:
        print("overflow")
    else:
        print(A[i]+B[i])

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[]
B=[]
for i in range(N):
    a = int(input())
    b = int(input())
    A.append(a)
    B.append(b)

for i in range(N):
    if A[i] >= 10 ** 79 or B[i] >= 10 ** 79:
        print("overflow")
    elif A[i] + B[i]>= 10 ** 79:
        print("overflow")
    else:
        print(str(A[i]+B[i]))

Submission status: Wrong Answer

Solution code:
N = int(input())
import re
for _ in [0]*N:
    a = tuple(map(int, input().zfill(100)))
    b = tuple(map(int, input().zfill(100)))
    result = []
    prev = 0
    for i in range(1, 80):
        n = int(a[-i]) + int(b[-i]) + prev
        result.append(n%10)
        prev = n // 10
    if a[-81] + b[-81] + prev > 0:
        print("overflow")
    else:
        print(re.sub(r"^0+", "", "".join(map(str, result[::-1]))))

Submission status: Wrong Answer

Solution code:
N = int(input())
import re
for _ in [0]*N:
    a = tuple(map(int, input().zfill(100)))
    b = tuple(map(int, input().zfill(100)))
    result = []
    prev = 0
    for i in range(1, 81):
        n = int(a[-i]) + int(b[-i]) + prev
        result.append(n%10)
        prev = n // 10
    if a[-81] + b[-81] + prev > 0:
        print("overflow")
    else:
        print(re.sub(r"^0+", "", "".join(map(str, result[::-1]))))

Submission status: Wrong Answer

Solution code:
N = int(input())
import re
for _ in [0]*N:
    a = input().zfill(100)
    b = input().zfill(100)
    result = []
    prev = 0
    for i in range(1, 81):
        n = int(a[-i]) + int(b[-i]) + prev
        result.append(n%10)
        prev = n // 10
    if int(a[-81]) + int(b[-81]) + prev > 0 or int(a[:20]) + int(b[:20]) > 0:
        print("overflow")
    else:
        print(re.sub(r"^0+", "", "".join(map(str, result[::-1]))))

Submission status: Wrong Answer

Solution code:
N = int(input())
import re
for _ in [0]*N:
    a = input().zfill(100)
    b = input().zfill(100)
    result = []
    prev = 0
    for i in range(1, 81):
        n = int(a[-i]) + int(b[-i]) + prev
        result.append(n%10)
        prev = n // 10
    if prev > 0 or int(a[:21]) + int(b[:21]) > 0:
        print("overflow")
    else:
        result = "".join(map(str, result[::-1]))
        print(int(result))

Submission status: Wrong Answer

Solution code:

if __name__ == '__main__':
    n = (int)(input())
    for _ in range(n):
        sNumber = (int)(input())
        tNumber = (int)(input())
        uNumber = sNumber+tNumber
        print("over flow" if uNumber > 10**80 else uNumber)

Submission status: Wrong Answer

Solution code:
for i in range(int(input())):
    try:
        a = sum([int(j) for j in input().split()])
    except:
        print("overflow")
    else:
        print(a)

Submission status: Wrong Answer

Solution code:
for i in range(int(input())):
    try:
        a = int32(sum([int32(j) for j in input().split()]))
    except:
        print("overflow")
    else:
        print(a)

Submission status: Wrong Answer

Solution code:
for i in range(int(input())):
    a = sum([int(j) for j in input().split()])
    if a > 2147483647:
        print("overflow")
    else:
        print(a)

Submission status: Wrong Answer

Solution code:
for i in range(int(input())):
    a = int(input()) + int(input())
    if a > 2147483647:
        print("overflow")
    else:
        print(a)

Submission status: Wrong Answer

Solution code:
for i in range(int(input())):
    a = int(input())
    b = int(input())
    if a + b > 2147483647:
        print("overflow")
    else:
        print(a)

Submission status: Wrong Answer

Solution code:
n = int(input())
for _ in range(n):
    a = input()
    if len(str(a)) > 80:
        print("overflow")
        continue
    b = input()
    if len(str(b)) > 80:
        print("overflow")
        continue
    c = int(a) + int(b)
    if len(str(c)) > 80:
        print("overflow")
    else:
        print(c)

Submission status: Wrong Answer

Solution code:
n = int(input())
for _ in range(n):
    a = input()
    if len(a) > 80:
        print("overflow")
        continue
    b = input()
    if len(b) > 80:
        print("overflow")
        continue
    c = int(a) + int(b)
    if len(str(c)) > 80:
        print("overflow")
    else:
        print(c)

Submission status: Wrong Answer

Solution code:
# coding:utf-8

syako = []
try:
    while True:
        number = int(raw_input())
        if number != 0:
            syako.append(number)
        elif number == 0:
            print syako.pop()
except:
    pass

Submission status: Wrong Answer

Solution code:
n = int(raw_input())
for i in range(0,n):
    #a,b=map(int,raw_input().splitlines())
    a = int(raw_input())
    b = int(raw_input())
    sum = a+b
    if len(str(sum)) < 80:
        print sum
    else:
        print "overflow"

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(n):
	x = int(input())
	y = int(input())
	ans = x + y
	if(ans <= 10**80):
		print(ans)
	else:
		print("overflow")

Submission status: Wrong Answer

Solution code:
from collections import deque

"""
# Too slow
def add2(a, b):
    a, b = align_digit(a, b)
    zipped = zip(a[::-1], b[::-1])
    carry = 0
    result = []
    for a, b in zipped:
        s = int(a) + int(b) + carry
        carry = int(s / 10)
        result.append(str(s % 10))
    if result[-1] == '0':
        result[-1] = str(carry)
    print(''.join(result[::-1]))
"""


def align_digit(a, b):
    la, lb = len(a), len(b)
    if la < lb:
        a = a.zfill(lb)
    elif lb < la:
        b = b.zfill(la)
    return a, b


def split_to_ints(s, n=10):
    length = len(s)
    return reversed([int(s[i:i + n]) for i in range(0, length, n)])


def add(a, b, n=10):
    a, b = align_digit(a, b)
    ints_a = split_to_ints(a, n)
    ints_b = split_to_ints(b, n)
    carry = 0
    result = deque()

    zipped = list(zip(ints_a, ints_b))
    for i, (int_a, int_b) in enumerate(zipped):
        s = int_a + int_b + carry
        carry = int(s / (10 ** n))
        if i != len(zipped) - 1:
            result.append(str(s % (10 ** (n - 1))).zfill(n))
        else:
            result.append(str(s))
        i += 1
    return str(int(''.join(result)))


if __name__ == '__main__':
    n_input = int(input())
    for i in range(n_input):
        a, b = input(), input()
        #print(a + b)
        print(add(a, b))

Submission status: Wrong Answer

Solution code:
from collections import deque

"""
# Too slow
def add2(a, b):
    a, b = align_digit(a, b)
    zipped = zip(a[::-1], b[::-1])
    carry = 0
    result = []
    for a, b in zipped:
        s = int(a) + int(b) + carry
        carry = int(s / 10)
        result.append(str(s % 10))
    if result[-1] == '0':
        result[-1] = str(carry)
    print(''.join(result[::-1]))
"""


def align_digit(a, b):
    la, lb = len(a), len(b)
    if la < lb:
        a = a.zfill(lb)
    elif lb < la:
        b = b.zfill(la)
    return a, b


def split_to_ints(s, n=10):
    length = len(s)
    return reversed([int(s[i:i + n]) for i in range(0, length, n)])


def add(a, b, n=10):
    a, b = align_digit(a, b)
    ints_a = split_to_ints(a, n)
    ints_b = split_to_ints(b, n)
    carry = 0
    result = deque()

    zipped = list(zip(ints_a, ints_b))
    for i, (int_a, int_b) in enumerate(zipped):
        s = int_a + int_b + carry
        carry = int(s / (10 ** n))
        if i != len(zipped) - 1:
            result.append(str(s % (10 ** (n - 1))).zfill(n))
        else:
            result.append(str(s))
        i += 1

    ret = str(int(''.join(result)))
    if len(ret) > 80:
        return 'overflow'
    return ret


if __name__ == '__main__':
    n_input = int(input())
    for i in range(n_input):
        a, b = input(), input()
        print(add(a, b))

Submission status: Wrong Answer

Solution code:
n = int(raw_input())
for i in range(0, n):
    x = int(raw_input())
    y = int(raw_input())
    print x+y

Submission status: Wrong Answer

Solution code:
n = int(raw_input())
for i in range(0, n):
    x = int(raw_input())
    y = int(raw_input())
    sum = str(x+y)
    if len(sum) >= 80:
        print 'overflow'
    else:
        print sum

Submission status: Wrong Answer

Solution code:
#!/bin/python

def largeBudget(a, b):
  if a+b > 10e+80:
    print("overflow")
  else:
    print("%d"%(a+b))

N = int(input())
for i in range(N):
  a = int(input())
  b = int(input())
  largeBudget(a, b)

Submission status: Wrong Answer

Solution code:
def largeBudget(a, b):
  if a > 1e+80 or b > 1e+80: print("overflow")
  elif a+b > 1e+80: print("overflow")
  else: print("%d"%(a+b))

N = int(input())
for i in range(N):
  a = int(input())
  b = int(input())
  largeBudget(a, b)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python
#-*- coding:utf-8 -*-

def largeBudget(a, b):
  if a >= 1e+80 or b >= 1e+80: print("overflow")
  elif a+b >= 1e+80: print("overflow")
  else: print("%d"%(a+b))

N = int(input())
for i in range(N):
  a = int(input())
  b = int(input())
  largeBudget(a, b)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python
#-*- coding:utf-8 -*-

def largeBudget(a, b):
  if a >= 1e+79 or b >= 1e+79: print("overflow")
  elif a+b >= 1e+79: print("overflow")
  else: print("%d"%(a+b))

N = int(input())
for i in range(N):
  a = int(input())
  b = int(input())
  largeBudget(a, b)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python
#-*- coding:utf-8 -*-

lim = 1000000000000000000000000000000000000000000000000000000000000000000000000000000 

def largeBudget(a, b):
  if a >= lim or b >= lim: print("overflow")
  elif a+b >= lim: print("overflow")
  else: print("%d"%(a+b))

N = int(input())
for i in range(N):
  a = int(input())
  b = int(input())
  largeBudget(a, b)

Submission status: Wrong Answer

Solution code:
count = int(input())
for a in range(count):
 q,w =int(input()),int(input())
 t=q+w
 if t >10**80:
   print "overflow"
 else:
   print t

Submission status: Wrong Answer

Solution code:
for i in range(int(input())): a=int(input()) ; b = int(input()) ; print a+b

Submission status: Wrong Answer

Solution code:
line_num = int(raw_input())
for n in range(line_num):
	a = raw_input()
	b = raw_input()
	if len(a) > 80 or len(b) > 80:
		print 'overflow'
	filled_a, filled_b = a.zfill(80), b.zfill(80)
	rlist_a = map(int,list(filled_a)[::-1])
	rlist_b = map(int,list(filled_b)[::-1])
	rlist_sum = []
	for n in range(80):
		rlist_sum.append(rlist_a[n]+rlist_b[n])
	for n in range(79):
		if rlist_sum[n] > 9:
			rlist_sum[n] -= 10
			rlist_sum[n+1] += 1
	if rlist_sum[79] > 9:
		print 'overflow'
	list_sum = []
	f = 0
	for n in rlist_sum[::-1]:
		if f > 0:
			list_sum.append(n)
		else:
			if n > 0:
				f = 1
				list_sum.append(n)
	print ''.join(map(str,list_sum))

Submission status: Wrong Answer

Solution code:
line_num = int(raw_input())
for n in range(line_num):
	a = raw_input()
	b = raw_input()
	ov = 0
	if len(a) > 80 or len(b) > 80:
		print 'overflow'
		ov = 1
	filled_a, filled_b = a.zfill(80), b.zfill(80)
	rlist_a = map(int,list(filled_a)[::-1])
	rlist_b = map(int,list(filled_b)[::-1])
	rlist_sum = []
	for n in range(80):
		rlist_sum.append(rlist_a[n]+rlist_b[n])
	for n in range(79):
		if rlist_sum[n] > 9:
			rlist_sum[n] -= 10
			rlist_sum[n+1] += 1
	if rlist_sum[79] > 9:
		if ov < 1:
			print 'overflow'
	else:
		list_sum = []
		f = 0
		for n in rlist_sum[::-1]:
			if f > 0:
				list_sum.append(n)
			else:
				if n > 0:
					f = 1
					list_sum.append(n)
		print ''.join(map(str,list_sum))

Submission status: Wrong Answer

Solution code:
n=input()
for i in xrange(n):
    a=input()
    b=input()
    sum=a+b
    if sum>10**80:
        print "overflow"
    else :
        print sum

Submission status: Wrong Answer

Solution code:
n=input()
for i in xrange(n):
    a=input()
    b=input()
    sum=a+b
    if sum>=10**79:
        print "overflow"
    else :
        print sum

Submission status: Wrong Answer

Solution code:
n=input()
for i in range(n):
    a=input()
    b=input()
    print a+b

Submission status: Wrong Answer

Solution code:
def datasets():
    import sys
    for i in range(int(sys.stdin.readline().strip())):
        s1 = sys.stdin.readline().strip()
        s2 = sys.stdin.readline().strip()
        yield s1, s2

for s1, s2 in datasets():
    if len(s1)>80 or len(s2)>80:
        print "overflow"
        continue
    print int(s1)+int(s2)

Submission status: Wrong Answer

Solution code:
for i in range(int(raw_input())):
    x = int(raw_input())
    y = int(raw_input())
    print x+y

Submission status: Wrong Answer

Solution code:
from __future__ import (absolute_import, division, print_function,
                        unicode_literals)
from sys import stdin

n = int(stdin.readline())
while n:
    result = long(stdin.readline()) + long(stdin.readline())
    if len(str(result)) >= 80:
        print('overflow')
    else:
        print(result)
    n -= 1

Submission status: Wrong Answer

Solution code:
'''
Created on Mar 21, 2013

@author: wukc
'''

from sys import stdin

n=int(stdin.readline())
for i in range(n):
    a,b=[stdin.readline().strip().lstrip("0") for k in range(2)]
    if len(a)>80 or len(b)>80:
        print("overflow")
        continue
    a,b=a.rjust(len(b),'0'),b.rjust(len(a),'0')
    ans=[]
    c=0
    for x,y in zip(a[::-1],b[::-1]):
        t=int(x)+int(y)+c
        c=t//10
        ans+=[t%10]
    ans+=[c]
    ans="".join(map(str,ans[::-1])).lstrip("0")
    if len(ans)>80:
        print("overflow")
        continue
    print(ans)

Submission status: Wrong Answer

Solution code:
for val in xrange(0,input()):
	a = input()
	b = input()
	c = a+b
	if len(str(a)) > 80 and len(str(b)) > 80 and len(str(c)) > 80: print c
	else: print 'overflow'

Submission status: Wrong Answer

Solution code:
c = int(raw_input())
for i in range(c):
    a = int(raw_input())
    if a == 1:
        break
    b = int(raw_input())
    print "%d" % (a+b)

Submission status: Wrong Answer

Solution code:
c = int(raw_input())
for i in range(c):
    a = int(raw_input())
    if a == 1:
        break
    b = int(raw_input())
    print "%s" % (str(a+b))

Submission status: Wrong Answer

Solution code:
n=input()
for i in range(n):
    x=input()
    y=input()
    print x+y

Submission status: Wrong Answer

Solution code:
n = int(raw_input())

for i in range(0,n):
    a = int(raw_input())
    b = int(raw_input())
    ans = str(a+b)

    if len(ans) > 80:
        print 'overflow'
    else:
        print sum

Submission status: Wrong Answer

Solution code:
n = int(raw_input())
for _ in range(n):
    print int(raw_input()) + int(raw_input())

Submission status: Wrong Answer

Solution code:
for x in range(input()):
    x = input() + input()
    print("{:.80g}".format(x) if x < 1E79 else "overflow")

Submission status: Wrong Answer

Solution code:
for x in range(input()):
    x = input() + input()
    print x if len(str(x)) < 80 else "overflow"

Submission status: Wrong Answer

Solution code:
for x in range(input()):
    a = input() + input()
    print a if len(str(a)) < 80 else "overflow"

Submission status: Wrong Answer

Solution code:

import math
n = input()
for i in range(n):
  a = input() + input()
  if(a > math.pow(10, 80)):
    print "overflow"
  else:
    print a

Submission status: Wrong Answer

Solution code:
n  = input()

i=0
while(i < 2):
        n1 = input()
        n2 = input()

        if n1 > 10**80:
                print "overflow"
        if n2 > 10**80:
                print "overflow"
        print n1 + n2
        i = i + 1

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

import sys


lineNumber = 0
#for line in [ "2", "1000", "800", "99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999", "1" ]:
for line in sys.stdin.readlines():
    lineNumber += 1

    # line exception
    if lineNumber == 1:
        continue
    
    # get data
    List = map(int, line.strip().split())

    # set data
    if lineNumber % 2 == 0: a = line.strip()
    else                  : b = line.strip()

    # sum
    if lineNumber % 2 == 1:
        maxlen = max(len(a), len(b))
        if maxlen >= 80:
            print "overflow"
            continue

        upper = 0
        c = ""
        for i in xrange(1, maxlen+1):
            try:
                buf = int(a[-i]) + int(b[-i]) + upper
                upper = buf / 10
                buf %= 10
            except:
                try:
                    buf = int(a[-i]) + upper
                    upper = buf / 10
                    buf %= 10
                except:
                    buf = int(b[-i]) + upper
                    upper = buf / 10
                    buf %= 10
            c = str(buf) + c

        if upper != 0: c = str(upper) + c

        if len(c) >= 80: print "overflow"
        else           : print c

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

import sys


lineNumber = 0
out = False
for line in [ "2", "1000", "800", "9999", "1" ]:
#for line in sys.stdin.readlines():
    lineNumber += 1

    # line exception
    if lineNumber == 1:
        continue
    
    # get data
    List = map(int, line.strip().split())

    # set data
    if lineNumber % 2 == 0: a = line.strip()
    else                  : b = line.strip()


    # sum
    if lineNumber % 2 == 1:
        if not out: out = True
        else      : print

        maxlen = max(len(a), len(b))
        if maxlen > 80:
            print "overflow",
            continue

        upper = 0
        c = ""
        for i in xrange(1, maxlen+1):
            try:
                buf = int(a[-i]) + int(b[-i]) + upper
                upper = buf / 10
                buf %= 10
            except:
                try:
                    buf = int(a[-i]) + upper
                    upper = buf / 10
                    buf %= 10
                except:
                    buf = int(b[-i]) + upper
                    upper = buf / 10
                    buf %= 10
            c = str(buf) + c

        if upper != 0: c = str(upper) + c

        if len(c) > 80: print "overflow",
        else          : print c,

Submission status: Wrong Answer

Solution code:
s="overflow"
m=1E79
n=input()
for i in range(n):
  a=input()
  b=input()
  if a<m and b<m:
    tmp=a+b
    if tmp<m: s=tmp
  print s

Submission status: Wrong Answer

Solution code:
s="overflow"
m=10**79
n=input()
for i in range(n):
  a=input()
  b=input()
  if a<m and b<m:
    tmp=a+b
    if tmp<m: s=tmp
  print s

Submission status: Wrong Answer

Solution code:

m=10**79
n=input()
for i in range(n):
  s="overflow"
  a=input()
  b=input()
  if a<m and b<m:
    tmp=a+b
    if tmp<m: s=tmp
  print s

Submission status: Wrong Answer

Solution code:
n = int(raw_input())
for i in range(n):
    a = int(raw_input())
    b = int(raw_input())
    if a+b >= 10**79: print 'overflow'
    else: print a+b

Submission status: Wrong Answer

Solution code:
n = input()
for i in range(n):
    print input() + input()

Submission status: Wrong Answer

Solution code:
import re

def readline():
    return raw_input()

def split8by10(str):
    str = str.rjust(80,'0')
    ss = []
    for s in range(0,len(str),10):
        ss.append(int(str[s:s+10]))
    return ss
def add8by10(a,b):
    c = [0 for i in range(0,8)]
    p = 10000000000
    for i in reversed(range(0,8)):
        c[i] += a[i] + b[i]
        if c[i] >= p:
            if i > 0:
                c[i-1] += c[i] // p
            else:
                return None
        c[i] = c[i] % p
    return c

n = int(readline())
for i in range(0,n):
    a = readline()
    b = readline()
    a = split8by10(a)
    b = split8by10(b)
    c = add8by10(a,b)
    if c is None:
        print "overflow"
    else:
        print re.sub('^0{,79}',"","".join(map(lambda x:str(x).rjust(10,'0'),c)))

Submission status: Wrong Answer

Solution code:
import re

def readline():
    return raw_input()

def split10by8(str):
    str = str.rjust(80,'0')
    ss = []
    for s in range(0,len(str),8):
        ss.append(int(str[s:s+8]))
    return ss
def add10by8(a,b):
    c = [0 for i in range(0,10)]
    p = 10**8
    for i in reversed(range(0,10)):
        c[i] += a[i] + b[i]
        if c[i] >= p:
            if i > 0:
                c[i-1] += c[i] // p
            else:
                return None
        c[i] = c[i] % p
    return c

n = int(readline())
for i in range(0,n):
    a = readline()
    b = readline()
    a = split10by8(a)
    b = split10by8(b)
    c = add10by8(a,b)
    if c is None:
        print "overflow"
    else:
        print re.sub('^0{,79}',"","".join(map(lambda x:str(x).rjust(8,'0'),c)))

Submission status: Wrong Answer

Solution code:
n=input()
for i in range(0,n):
 a=input()
 b=input()
 print a+b

Submission status: Accepted

Solution code:
n = int(raw_input())
for i in range(n):
    a = long(raw_input())
    b = long(raw_input())
    tmp = str(a+b)
    if len(tmp) > 80:
        print "overflow"
    else:
        print tmp