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:
n=int(input())
for i in range(n):
    a=int(input())
    b=int(input())
    if a+b>=10**79:print("overflow")
    else:print(a+b)

Submission status: Wrong Answer

Solution code:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

n = int(input())
ans = []
for _ in range(n):
    a = int(input())
    b = int(input())
    s = a+b
    if s >= 10**79:
        ans.append("overflow")
    else:
        ans.append(str(s))
print("\n".join(ans))

Submission status: Wrong Answer

Solution code:
for i in range(int(input())):
    n1 = list(input())
    n2 = list(input())
    if len(n2) > len(n1):
        n1, n2 = n2, n1

    ans = []
    for i in range(len(n1)):
        a = int(ans.pop(0)) if len(ans) == i + 1 else 0
        c1 = int(n1.pop(-1))
        c2 = int(n2.pop(-1)) if len(n2) != 0 else 0
        ans = list(str(a + c1 + c2)) + ans
    print(''.join(ans))

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    nset = int(input())

    for i in range(0,nset):
        a = int(input())
        b = int(input())
        print(a+b)

Submission status: Wrong Answer

Solution code:
import math

n1 = input();
n2 = input();
sum = int(n1) + int(n2);

if int(math.log10(sum)) + 1 >= 80 :
	print("overflow");
else :
	print(sum)

Submission status: Wrong Answer

Solution code:
import math

n1 = input();
n2 = input();
sum = int(n1) + int(n2);

if int(math.log10(sum)) + 1 > 80 :
	print("overflow");
else :
	print(sum)

Submission status: Wrong Answer

Solution code:
import math

n1 = input();
n2 = input();
sum = int(n1) + int(n2);

if int(math.log10(sum)) + 1 > 80 :
	print("overflow");
else :
	print(sum);

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
while(True):
    try:
        n = input()
        for i in range(n):
            a = input()
            b = input()
            c = str(a + b)
            if(len(c) >= 80):
                print("overflow")
            else:
                print(c)
    except Exception:
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
a=int(input())
b=int(input())
c=a+b
for x in range(80):
	c=math.floor(c/10)
if(c>=1):
	print("overflow")
else:
	print(a+b)

Submission status: Wrong Answer

Solution code:
n=int(input())
for n in range(n):
	a=int(input())
	b=int(input())
	c=a+b
	if c>=int(1e79):
		print("overflow")
	else:
		print(c)

Submission status: Wrong Answer

Solution code:
n=int(input())
for n in range(n):
	a=int(input())
	b=int(input())
	c=a+b
	if c>=int(1e80):
		print("overflow")
	else:
		print(c)

Submission status: Wrong Answer

Solution code:
n=int(input())
for n in range(n):
	a=int(input())
	b=int(input())
	c=a+b
	if a>=int(1e79) or b>=int(1e79) or c>=int(1e79):
		print("overflow")
	else:
		print(c)

Submission status: Wrong Answer

Solution code:
n=int(input())
for n in range(n):
	a=int(input())
	b=int(input())
	c=a+b
	if a>=int(1e80) or b>=int(1e80) or c>=int(1e80):
		print("overflow")
	else:
		print(c)

Submission status: Wrong Answer

Solution code:
n=int(input())
for i in range(n):
	a=int(input())
	b=int(input())
	c=a+b
	if a>=int(1e80) or b>=int(1e80) or c>=int(1e80):
		print("overflow")
	else:
		print(c)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=a+b
c=str(c)
if len(c)>80:
	print("overflow")
else:
	print(c)

Submission status: Wrong Answer

Solution code:
n = int(input())
for _ in range(n):
    a = sum([int(input()) for _ in range(2)])
    if len(str(a)) < 80:
        print(a)
    else:
        print('overflow')

Submission status: Wrong Answer

Solution code:
n = int(input())
for _ in range(n):
    a, b = input(), input()
    m = abs(len(a) - len(b))
    if len(a) > len(b):
        a = '0' + a
        b = '0' * (m+1) + b
    else:
        a = '0' * m + a
        b = '0' + b
    a, b = a[::-1], b[::-1]
    
    budget = []
    flag = False
    for i in range(0, len(a), 10):
        t = int(a[i:i+10][::-1]) + int(b[i:i+10][::-1]) 
        if flag: t += 1
        t = str(t)

        if len(t) > 10:
            t = t[1:]
            flag = True
        elif i + 10 <= len(a):
            t = '0' * abs(len(t) - 10) + t
            flag = False
        else:
            flag = False
        budget.append(t)
    
    print(''.join(budget[::-1]))

Submission status: Wrong Answer

Solution code:
n = int(input())
for _ in range(n):
    a, b = input(), input()
    m = abs(len(a) - len(b))
    if len(a) > len(b):
        a = '0' + a
        b = '0' * (m+1) + b
    else:
        a = '0' * m + a
        b = '0' + b
    a, b = a[::-1], b[::-1]
    
    budget = []
    flag = False
    for i in range(0, len(a), 10):
        t = int(a[i:i+10][::-1]) + int(b[i:i+10][::-1]) 
        if flag: t += 1
        t = str(t)

        if len(t) > 10:
            t = t[1:]
            flag = True
        elif i + 10 < len(a):
            t = '0' * abs(len(t) - 10) + t
            flag = False
        else:
            flag = False
        budget.append(t)
    
    print(''.join(budget[::-1]))

Submission status: Wrong Answer

Solution code:
n = int(input())
for _ in range(n):
    a, b = input(), input()
    m = abs(len(a) - len(b))
    if len(a) > len(b):
        a = '0' + a
        b = '0' * (m+1) + b
    else:
        a = '0' * m + a
        b = '0' + b
    a, b = a[::-1], b[::-1]
    
    budget = []
    flag = False
    for i in range(0, len(a), 10):
        t = int(a[i:i+10][::-1]) + int(b[i:i+10][::-1]) 
        if flag: t += 1
        t = str(t)

        if len(t) > 10:
            t = t[1:]
            flag = True
        elif i + 10 < len(a):
            t = '0' * abs(len(t) - 10) + t
            flag = False
        else:
            flag = False
        budget.append(t)
    
    budget = ''.join(budget[::-1])
    if len(budget) < 80:
        print(''.join(budget[::-1]))
    else:
        print('overflow')

Submission status: Wrong Answer

Solution code:
n = int(input())
for _ in range(n):
    a, b = input(), input()
    m = abs(len(a) - len(b))
    if len(a) > len(b):
        a = '0' + a
        b = '0' * (m+1) + b
    else:
        a = '0' * m + a
        b = '0' + b
    a, b = a[::-1], b[::-1]
    
    budget = []
    flag = False
    for i in range(0, len(a), 10):
        t = int(a[i:i+10][::-1]) + int(b[i:i+10][::-1]) 
        if flag: t += 1
        t = str(t)

        if len(t) > 10:
            t = t[1:]
            flag = True
        elif i + 10 < len(a):
            t = '0' * abs(len(t) - 10) + t
            flag = False
        else:
            flag = False
        budget.append(t)
    
    budget = ''.join(budget[::-1])
    if len(budget) < 80:
        print(budget)
    else:
        print('overflow')

Submission status: Wrong Answer

Solution code:
n = int(input())
for _ in range(n):
    a, b = input(), input()
    m = abs(len(a) - len(b))
    if len(a) > len(b):
        a = '0' + a
        b = '0' * (m+1) + b
    else:
        a = '0' * m + a
        b = '0' + b
    a, b = a[::-1], b[::-1]
    
    budget = []
    flag = False
    for i in range(0, len(a), 10):
        t = int(a[i:i+10][::-1]) + int(b[i:i+10][::-1]) 
        if flag: t += 1
        t = str(t)

        if len(t) > 10:
            t = t[1:]
            flag = True
        elif i + 10 <= len(a):
            t = '0' * abs(len(t) - 10) + t
            flag = False
        else:
            flag = False
        budget.append(t)
    
    budget = ''.join(budget[::-1])
    if len(budget) < 80:
        print(budget)
    else:
        print('overflow')

Submission status: Wrong Answer

Solution code:
import sys

a = int(input())
b = int(input())
print(a + b)

Submission status: Wrong Answer

Solution code:
import sys
f = sys.stdin
n = int(f.readline())
for _ in range(n):
    a = f.readline().strip()
    b = f.readline().strip()
    c = int(a) + int(b)
    c = '{}'.format(c)
    print(c if len(c) else 'overflow ')

Submission status: Wrong Answer

Solution code:
import sys
f = sys.stdin
n = int(f.readline())
for _ in range(n):
    a = f.readline().strip()
    b = f.readline().strip()
    c = int(a) + int(b)
    c = '{}'.format(c)
    print(c if len(c) else 'overflow')

Submission status: Wrong Answer

Solution code:
for x in range(input()):
    x=raw_input()
    x=x[::-1]
    y=raw_input()
    y=y[::-1]
    z=[0]*81
    if len(x)>80 or len(y) >80:
        print 'overflow'
    else:
        for i in xrange(len(x)):
            z[i]=int(x[i])
        for j in xrange(len(y)):
            z[j]=z[j]+int(y[j])
        for k in xrange(max(len(x),len(y))):
            sum=z[k]
            z[k]=sum%10
            z[k+1]+=sum/10
        z.reverse()
        if z[0]!=0:
            print 'overflow'
        else:
            for j in xrange(len(z)):
                if z[0]==0:
                    z.pop(0)
                else:
                    break
            print ''.join(map(str,z))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(raw_input())

while n:
	n -= 1
	a = long(raw_input())
	b = long(raw_input())
	
	print a+b

Submission status: Wrong Answer

Solution code:
n = int(raw_input())

while n:
	n -= 1
	a = long(raw_input())
	b = long(raw_input())
	
	print str(a+b)

Submission status: Wrong Answer

Solution code:
for x in[sum([input(),input()])for i in range(input())]:print x

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())

    for i in range(n):
        val1 = int(input())
        val2 = int(input())
        print(str(val1 + val2))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
print("In preparation.")

Submission status: Wrong Answer

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

import sys
import math

n = int(input())

for _ in range(n):
    x = int(input())
    y = int(input())
    print(x+y)

Submission status: Wrong Answer

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

import sys
import math

n = int(input())
anss = []

for _ in range(n):
    x = int(input())
    y = int(input())
    anss.append(x+y)

for data in anss:
    print(data)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
n = int(raw_input());
for i in range(0, n):
    a = int(raw_input());
    b = int(raw_input());
    print a + b;

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
n = int(raw_input());
for i in range(0, n):
    a = long(raw_input());
    b = long(raw_input());
    print a + b;

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import math
n = int(raw_input());
over = 10 ** 80;
for i in range(0, n):
    a = int(raw_input());
    b = int(raw_input());
    if a + b > over:
        print "overflow"
    else:
        print a + b;

Submission status: Wrong Answer

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

def main():
    LIST=[]
    for i in range(int(input())):
        a=int(input())
        b=int(input())
        LIST.append(a+b)

        if len(LIST)>80:
            print("overflow")
            break

    for v in LIST:
        print(v)
            
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

def main():
    LIST=[]
    for i in range(int(input())):
        a=int(input())
        b=int(input())
        LIST.append(a+b)

        if len(LIST)>80:
            print("overflow")
            break

    for v in LIST:
        print(str(v))
            
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

def main():
    for i in range(int(input())):
        a=str(int(input())+int(input()))
        if len(a)>80:
            print("overflow")
            break
        print(a)
            
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

def main():
    for i in range(int(input())):
        a=int(input())+int(input())
        if a>=10**80:
            print("overflow")
        print(a)
            
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())

for i in range(n):
    a = int(input())
    b = int(input())

    print(a + b)

Submission status: Wrong Answer

Solution code:
while True:
	try:
		n = input()
		for i in range(n):
			a = input()
			b = input()
			print a+b
	except EOFError:
		break

Submission status: Wrong Answer

Solution code:
n=int(input())
for i in range(n):
    a=input()
    if a==1:
        break
    b=input()
    print(str(a)+str(b))

Submission status: Wrong Answer

Solution code:
n = input()
for i in xrange(n):
    num1 = input()
    if len(str(num1))>80:
        print "overflow"
        break
    num2 = input()
    if len(str(num2))>80:
        print "overflow"
        break
    ans = num1+num2
    if len(str(ans)) > 80:
        print "overflow"
    else:
        print ans

Submission status: Wrong Answer

Solution code:
n = input()
for i in xrange(n):
    num1 = input()
    if len(str(num1))>=80:
        print "overflow"
        break
    num2 = input()
    if len(str(num2))>=80:
        print "overflow"
        break
    ans = num1+num2
    if len(str(ans)) >= 80:
        print "overflow"
    else:
        print ans

Submission status: Wrong Answer

Solution code:
n = input()
for i in xrange(n):
    num1 = input()
    if len(str(num1))>80:
        print "overflow"
        continue
    num2 = input()
    if len(str(num2))>80:
        print "overflow"
        continue
    ans = num1+num2
    if len(str(ans)) > 80:
        print "overflow"
    else:
        print ans

Submission status: Wrong Answer

Solution code:
n = input()
for i in xrange(n):
    num1 = input()
    if len(str(num1))>=80:
        print "overflow"
        continue
    num2 = input()
    if len(str(num2))>=80:
        print "overflow"
        continue
    ans = num1+num2
    if len(str(ans)) >= 80:
        print "overflow"
    else:
        print ans

Submission status: Wrong Answer

Solution code:
n = input()
for i in xrange(n):
    num1 = input()
    # if len(str(num1))>80:
    #     print "overflow"
    #     continue
    num2 = input()
    # if len(str(num2))>80:
    #     print "overflow"
    #     continue
    ans = num1+num2
    # if len(str(ans)) > 80:
    #     print "overflow"
    # else:
    #     print ans
    print ans

Submission status: Wrong Answer

Solution code:
N = input();

for i in range(N):
    s1 = raw_input()
    s2 = raw_input()
    if len(s1) > len(s2):
        l2 = list(s1)
        l1 = list(s2)
    else:
        l1 = list(s1)
        l2 = list(s2)
    l1.reverse()
    l2.reverse()
    for j in range(len(l1), len(l2)):
        l1.append("0")
    lst = [0]
    for j in range(len(l2)):
        lst[j] += (int(l1[j]) + int(l2[j])) % 10
        lst.append((int(l1[j]) + int(l2[j])) // 10)
        lst[j] = str(lst[j])
    else:
        lst[len(lst)-1] = str(lst[len(lst)-1])
    lst.reverse()
    if lst[0] == "0":
        lst.reverse()
        lst.pop()
        lst.reverse()
    print "".join(lst)

Submission status: Wrong Answer

Solution code:
N = input();

for i in range(N):
    s1 = raw_input()
    s2 = raw_input()
    if len(s1) > len(s2):
        l2 = list(s1)
        l1 = list(s2)
    else:
        l1 = list(s1)
        l2 = list(s2)
    l1.reverse()
    l2.reverse()
    for j in range(len(l1), len(l2)):
        l1.append("0")
    lst = [0]
    for j in range(len(l2)):
        lst[j] += (int(l1[j]) + int(l2[j])) % 10
        lst.append((int(l1[j]) + int(l2[j])) // 10)
        lst[j] = str(lst[j])
    else:
        lst[len(lst)-1] = str(lst[len(lst)-1])
    lst.reverse()
    if lst[0] == "0":
        lst.reverse()
        lst.pop()
        lst.reverse()
    print "".join(lst) if len(lst) <= 80 else "overflow"

Submission status: Wrong Answer

Solution code:
l = int(input())
for i in range(l):
    a = int(input()) + int(input())
    if(a >= 1E79):
        print('overflow')
    else:
        print(a)

Submission status: Wrong Answer

Solution code:
l = int(input())
for i in range(l):
    a = int(input()) + int(input())
    if(a >= 1E80):
        print('overflow')
    else:
        print(a)

Submission status: Wrong Answer

Solution code:
l = int(input())
for i in range(l):
    a = int(input()) + int(input())
    if(a > 1E80):
        print('overflow')
    else:
        print(a)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=[]
while True:
	try:
		x=int(input())
		A.append(x)
	except EOFError:
		break
start=0
end=start+n
for i in range(len(A)//n):
	print(sum(A[start:end]))
	start+=n
	end+=n

Submission status: Wrong Answer

Solution code:
n=int(input())
A=[]
while True:
	try:
		x=int(input())
		A.append(x)
	except EOFError:
		break
start=0
end=start+n
for i in range(len(A)//n):
	s=sum(A[start:end])
	if s/1e80>1:
		print("overflow")
	else:
		print(s)
	start+=n
	end+=n

Submission status: Wrong Answer

Solution code:
n=int(input())
for _ in range(n):
	s=int(input())+int(input())
	print('overflow' if s/1e80>1 else s)

Submission status: Wrong Answer

Solution code:
#encoding=utf-8

x = input()
for i in xrange(x):
	x = input()
	y = input()
	print x + y

Submission status: Wrong Answer

Solution code:
#encoding=utf-8

x = input()
for i in xrange(x):
	x = input()
	y = input()
	print str(x + y)

Submission status: Wrong Answer

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

n = int(raw_input())
for i in range(n):
    a = str(raw_input())
    b = str(raw_input())
    if len(a) < len(b):
        a, b = b, a
    l = len(a)
    for j in range(len(b), len(a)):
        b = '0'+b
    sum = ""
    nextdigit = 0
    for j in range(l):
        digit = int(a[l-1-j]) + int(b[l-1-j]) + nextdigit
        nextdigit = 0
        if (nextdigit+digit) >= 10:
            nextdigit = 1
            digit %= 10
        sum = str(digit) + sum
    if nextdigit:
        sum = '1'+sum
    print sum

Submission status: Wrong Answer

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

n = int(raw_input())
ans = []
for i in range(n):
    a = str(raw_input())
    b = str(raw_input())
    if len(a) < len(b):
        a, b = b, a
    l = len(a)
    for j in range(len(b), len(a)):
        b = '0'+b
    sum = ""
    nextdigit = 0
    for j in range(l):
        digit = int(a[l-1-j]) + int(b[l-1-j]) + nextdigit
        nextdigit = 0
        if (nextdigit+digit) >= 10:
            nextdigit = 1
            digit %= 10
        sum = str(digit) + sum
    if nextdigit:
        sum = '1'+sum
    ans.append(sum)
for i in ans:
    print i

Submission status: Wrong Answer

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

n = int(raw_input())
ans = []
for i in range(n):
    a = str(raw_input())
    b = str(raw_input())
    if len(a) < len(b):
        a, b = b, a
    l = len(a)
    for j in range(len(b), len(a)):
        b = '0'+b
    sum = ""
    nextdigit = 0
    for j in range(l):
        digit = int(a[l-1-j]) + int(b[l-1-j]) + nextdigit
        nextdigit = 0
        if (nextdigit+digit) >= 10:
            nextdigit = 1
            digit %= 10
        sum = str(digit) + sum
    if nextdigit:
        sum = '1'+sum
    ans.append(sum)
for i in ans:
    print int(i)

Submission status: Wrong Answer

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

n = int(raw_input())
ans = []
for i in range(n):
    a = str(raw_input())
    b = str(raw_input())
    if len(a) < len(b):
        a, b = b, a
    l = len(a)
    for j in range(len(b), len(a)):
        b = '0'+b
    sum = ""
    nextdigit = 0
    for j in range(l):
        digit = int(a[l-1-j]) + int(b[l-1-j]) + nextdigit
        nextdigit = 0
        if (nextdigit+digit) >= 10:
            nextdigit = 1
            digit %= 10
        sum = str(digit) + sum
    if nextdigit:
        sum = '1'+sum
    ans.append(sum)
for i in ans:
    print i if len(i) < 80 else "overflow"

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
for i in range(N):
    a = int(input())
    b = int(input())
    if (a != 0 and math.log10(a) > 79) or (b != 0 and math.log10(b) > 79) or (a + b != 0 and math.log10(a + b)) > 79:
        print("overflow")
    else:
        print(a + b)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
for i in range(N):
    a = int(input())
    b = int(input())
    if a >= 10**79 or b >= 10 ** 79 or a + b >= 10 ** 79:
        print("overflow")
    else:
        print(a + b)

Submission status: Wrong Answer

Solution code:
import sys
import itertools

dataset_num = int(input())

class Overflow(Exception):
    pass

for _ in range(dataset_num):
    try:
        k1 = input()
        k2 = input()
        k1_val = [0] * 80
        k2_val = [0] * 80

        if len(k1) >= 80 or len(k2) >= 80:
            raise Overflow()
        
        for i, x in enumerate(reversed(k1)):
            k1_val[i] = int(x)

        for i, x in enumerate(reversed(k2)):
            k2_val[i] = int(x)
        
        res = [0] * 80
        for i in range(0, 80):
            res[i] += k1_val[i] + k2_val[i]
            if res[i] >= 10:
                res[i+1] += 1
                res[i] -= 10
        sumstr = "".join([str(x) for x in itertools.dropwhile(lambda x: x == 0, reversed(res))])
        if len(sumstr) >= 80:
            raise Overflow()

        print(sumstr)
    except Overflow:
        print("overflow")

Submission status: Wrong Answer

Solution code:
import sys
import itertools

dataset_num = int(input())

class Overflow(Exception):
    pass

for _ in range(dataset_num):
    try:
        k1 = input()
        k2 = input()
        k1_val = [0] * 100
        k2_val = [0] * 100

        if len(k1) > 80 or len(k2) > 80:
            raise Overflow()
        
        for i, x in enumerate(reversed(k1)):
            k1_val[i] = int(x)

        for i, x in enumerate(reversed(k2)):
            k2_val[i] = int(x)
        
        res = [0] * 100 
        for i in range(0, 100):
            res[i] += k1_val[i] + k2_val[i]
            if res[i] >= 10:
                res[i+1] += 1
                res[i] -= 10
        sumstr = "".join([str(x) for x in itertools.dropwhile(lambda x: x == 0, reversed(res))])
        if len(sumstr) > 80:
            raise Overflow()

        print(sumstr)
    except Overflow:
        print("overflow")

Submission status: Wrong Answer

Solution code:
import sys
import itertools

dataset_num = int(input())

class Overflow(Exception):
    pass

for _ in range(dataset_num):
    try:
        k1 = input()
        k2 = input()
        k1_val = [0] * 100
        k2_val = [0] * 100

        if len(k1) >= 80 or len(k2) >= 80:
            raise Overflow()
        
        for i, x in enumerate(reversed(k1)):
            k1_val[i] = int(x)

        for i, x in enumerate(reversed(k2)):
            k2_val[i] = int(x)
        
        res = [0] * 100 
        for i in range(0, 100):
            res[i] += k1_val[i] + k2_val[i]
            if res[i] >= 10:
                res[i+1] += 1
                res[i] -= 10
        sumstr = "".join([str(x) for x in itertools.dropwhile(lambda x: x == 0, reversed(res))])
        if len(sumstr) >= 80:
            raise Overflow()

        print(sumstr)
    except Overflow:
        print("overflow")

Submission status: Wrong Answer

Solution code:
n=int(input())
ans_list=[]

for i in range(n):
	a=int(input())
	b=int(input())
	ans_list.append(a+b)

for i in ans_list:
	print(i)

Submission status: Wrong Answer

Solution code:
n = int(input())

for i in range(0, n):
    a = int(input())
    b = int(input())
    if a + b > 10 ** 80:
        print("overflow")
    elif a > 10 ** 80:
        print("overflow")
    elif b > 10 ** 80:
        print("overflow")
    else :
        print(a + b)

Submission status: Wrong Answer

Solution code:
n = int(input())

for i in range(0, n):
    a = int(input())
    b = int(input())
    if len(str(a + b)) >= 80:
        print("overflow")
    elif len(str(a)) >= 80:
        print("overflow")
    elif len(str(b)) >= 80:
        print("overflow")
    else :
        print(a + b)

Submission status: Wrong Answer

Solution code:
ans = []
i = int(input())
for n in range(i):
    j = int(input())
    k = int(input())
    x = str(j + k)
    if len(x) >= 80:
        ans.append("overflow")
    else:
        ans.append(x)
for n in range(i):
    print(ans[n])

Submission status: Wrong Answer

Solution code:
i = int(input())
for n in range(i):
    j = int(input())
    k = int(input())
    if len(str(j + k)) >= 80:
        print("overflow")
    else:
        print(j + k)

Submission status: Wrong Answer

Solution code:
i = int(input())
for n in range(i):
    j = int(input())
    k = int(input())
    if len(str(j + k)) > 80:
        print("overflow")
    elif len(str(j)) or len(str(k)):
        print("overflow")
    else:
         print(j + k)

Submission status: Wrong Answer

Solution code:
i = int(input())
for n in range(i):
    j = int(input())
    k = int(input())
    if len(str(j + k)) > 80:
        print("overflow")
    elif len(str(j)) or len(str(k)) > 80:
        print("overflow")
    else:
         print(j + k)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

for i in range(n):
    a = int(input())
    b = int(input())
    print((str(a+b)))

Submission status: Wrong Answer

Solution code:
N = input()
for i in range(N):
    a = input()
    b = input()
    if a >= 1E80 or b >= 1E80 or a+b >= 1E80:
        print "overflow"
    else:
        print a+b

Submission status: Wrong Answer

Solution code:
def Add(numa, numb):
	longer = (numa if len(numa) >= len(numb) else numb)
	shorter = (numa if len(numa) < len(numb) else numb)
	carry = 0
	result = ''
	for s in range(-1,-len(shorter) - 1, -1):
		ans = int(longer[s]) + int(shorter[s]) + carry
		if ans >= 10:
			result = str(ans % 10) + result
			carry = 1
		else:
			result = str(ans) + result
			carry = 0
	for l in range(-len(shorter) - 1, -len(longer) - 1, -1):
		ans = int(longer[l]) + carry
		if ans >= 10:
			result = str(ans % 10) + result
			carry = 1
		else:
			result = str(ans) + result
			carry = 0
	return (result if carry == 0 else '1' + result)

N = eval(input())
for _ in range(N):
	a = input()
	b = input()
	print(Add(a, b))

Submission status: Wrong Answer

Solution code:
def Add(numa, numb):
	longer = (numa if len(numa) >= len(numb) else numb)
	shorter = (numa if len(numa) < len(numb) else numb)
	carry = 0
	result = ''
	for s in range(-1, -len(shorter) - 1, -1):
		ans = int(longer[s]) + int(shorter[s]) + carry
		if ans >= 10:
			result = str(ans % 10) + result
			carry = 1
		else:
			result = str(ans) + result
			carry = 0
	for l in range(-len(shorter) - 1, -len(longer) - 1, -1):
		ans = int(longer[l]) + carry
		if ans >= 10:
			result = str(ans % 10) + result
			carry = 1
		else:
			result = str(ans) + result
			carry = 0
	return (result if carry == 0 else '1' + result)

N = eval(input())
for _ in range(N):
	a = input()
	b = input()
	print(Add(a, b))

Submission status: Wrong Answer

Solution code:
def Add(numa, numb):
	longer = (numa if len(numa) >= len(numb) else numb)
	shorter = (numa if len(numa) < len(numb) else numb)
	carry = 0
	result = ''
	for s in range(-1, -len(shorter) - 1, -1):
		ans = int(longer[s]) + int(shorter[s]) + carry
		if ans >= 10:
			result = str(ans % 10) + result
			carry = 1
		else:
			result = str(ans) + result
			carry = 0
	for l in range(-len(shorter) - 1, -len(longer) - 1, -1):
		ans = int(longer[l]) + carry
		if ans >= 10:
			result = str(ans % 10) + result
			carry = 1
		else:
			result = str(ans) + result
			carry = 0
	return (result if carry == 0 else '1' + result)

N = eval(input())
for _ in range(N):
	a = input()
	b = input()
	ans = Add(a, b)
	print('overflow' if len(a) >= 80 or len(b) >= 80 or len(ans) >= 80 else ans)

Submission status: Wrong Answer

Solution code:
for _ in range(int(input())):
    a = int(input())
    b = int(input())
    s = a + b
    if s >= 1e79:
        print('overflow')
    else:
        print(s)

Submission status: Wrong Answer

Solution code:
for _ in range(int(input())):
    a = int(input())
    b = int(input())
    s = a + b
    if s >= 1e80:
        print('overflow')
    else:
        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())

  print a + b

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 - 1:
    print "overflow"

  else:
    print a + b

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(n):
	s = int(input())+int(input())
	if len(str(s))>=80:
		print("overflow")
	else:
		print(s)

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(n):
	s = int(input())+int(input())
	if len(str(s))>=10**80:
		print("overflow")
	else:
		print(s)

Submission status: Wrong Answer

Solution code:
n = input()
for i in xrange(n):
    print long(raw_input()) + long(raw_input())