submission_id string | problem_id string | status string | code string | input string | output string | problem_description string |
|---|---|---|---|---|---|---|
s010659756 | p00015 | Wrong Answer |
import math
n = input()
for i in range(n):
a = input() + input()
if(a > math.pow(10, 80)):
print "overflow"
else:
print a | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s259087769 | p00015 | Wrong Answer | 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 | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s247314295 | p00015 | Wrong Answer | # -*- 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 | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s516301008 | p00015 | Wrong Answer | # -*- 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, | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s531306213 | p00015 | Wrong Answer | 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 | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s681360986 | p00015 | Wrong Answer | 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 | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s835275260 | p00015 | Wrong Answer |
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 | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s506937108 | p00015 | Wrong Answer | 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 | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s860003202 | p00015 | Wrong Answer | n = input()
for i in range(n):
print input() + input() | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s647988127 | p00015 | Wrong Answer | 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))) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s043913465 | p00015 | Wrong Answer | 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))) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s876831893 | p00015 | Wrong Answer | n=input()
for i in range(0,n):
a=input()
b=input()
print a+b | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s654823101 | p00015 | Accepted | 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
| 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s532075002 | p00015 | Accepted | # 国家予算
def main():
N = int(input())
for _ in range(N):
n1 = input().strip()
n2 = input().strip()
#print(f"n1: {n1}\nn2: {n2}")
if len(n1) > 80 or len(n2) > 80:
print("overflow")
continue
print(add(n1, n2))
return
def add(n1, n2):
"""n1, n2: str"""
kotae = ""
n1 = n1[::-1] # reversed
n2 = n2[::-1]
if len(n1) < len(n2): # 長い方がn1
n1, n2 = n2, n1
shorter = min(len(n1), len(n2))
longer = max(len(n1), len(n2))
idx, kuriagari = 0, 0
while idx < longer:
if idx >= shorter:
tmp = int(n1[idx]) + kuriagari
#print(f"idx: {idx}, tmp: {tmp}")
kuriagari = 1 if tmp >= 10 else 0
kotae += str(tmp)[-1]
idx += 1
while idx < shorter:
tmp = int(n1[idx]) + int(n2[idx]) + kuriagari
#print(f"idx: {idx}, tmp: {tmp}")
kuriagari = 1 if tmp >= 10 else 0
kotae += str(tmp)[-1]
idx += 1
if kuriagari:
kotae += "1"
if len(kotae) > 80:
return "overflow"
else:
return kotae[::-1]
if __name__ == "__main__":
main()
| 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s625575862 | p00015 | Accepted | n=int(input())
for i in range(n):
a=int(input())
b=int(input())
if a+b>=10**80:print("overflow")
else:print(a+b)
| 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s736807739 | p00015 | Accepted | # 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**80-1:
ans.append("overflow")
else:
ans.append(str(s))
print("\n".join(ans))
| 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s857555718 | p00015 | Accepted | r=raw_input
for a in range(int(r())):
s=sum([int(r()),int(r())])
print s>=10**80 and "overflow" or s | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s764368584 | p00015 | Accepted | #! -*- coding: utf-8-unix -*-
import sys
# if __name__=='__main__':
# lines = [int(x.strip()) for x in sys.stdin.readlines()]
# print lines
# n = lines[0]
# for i in xrange(n):
# # a, b = int(lines[i+1]), int(lines[i+2])
# a, b = lines[2*i+1], lines[2*i+2]
# if len(str(a+b)) > 80:
# print 'overflow'
# else:
# print a+b
if __name__=='__main__':
# lines = [int(x.strip()) for x in sys.stdin.readlines()]
# n = lines[0]
n = input()
for i in xrange(n):
# a, b = int(lines[i+1]), int(lines[i+2])
# a, b = lines[2*i+1], lines[2*i+2]
a, b = input(), input()
if len(str(a+b)) > 80:
print 'overflow'
else:
print a+b | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s521626063 | p00015 | Accepted | import sys
if __name__=='__main__':
lines = [int(x.strip()) for x in sys.stdin.readlines() if x != '' and x != '\n']
n = lines[0]
for i in xrange(n):
a, b = lines[2*i+1], lines[2*i+2]
if len(str(a+b)) > 80:
print 'overflow'
else:
print a+b | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s705897466 | p00015 | Accepted | N = 10 ** 80
for i in range(int(input())):
n = int(input()) + int(input())
print(n if n < N else 'overflow') | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s274296928 | p00015 | Accepted | if __name__ == "__main__":
nset = int(input())
for i in range(0, nset):
sa = input()
sb = input()
a = int(sa)
b = int(sb)
c = a + b
if len(sa) > 80 or len(sb) > 80 or len(str(c)) > 80:
print("overflow")
else:
print(c) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s850245225 | p00015 | Accepted | 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 | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s980917527 | p00015 | Accepted | n=int(input())
for i in range(n):
a=int(input())
b=int(input())
c=a+b
c=str(c)
if len(c)>80:
print("overflow")
else:
print(c) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s378368571 | p00015 | Accepted | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
num = input()
for i in range(num):
s = long(input())
t = long(input())
u = s+t
if len(str(u)) > 80 :
print "overflow"
else:
print u | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s054035422 | p00015 | Accepted | n = int(raw_input())
for i in range(n):
a = raw_input()
b = raw_input()
if len(a) > 80 or len(b) > 80:
print 'overflow'
else:
a, b = int(a), int(b)
c = a + b
if len(str(c)) > 80:
print 'overflow'
else:
print c | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s345300155 | p00015 | Accepted | N = 10**80
for i in range(int(input())):
n = int(input()) + int(input())
print(n if n < N else "overflow") | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s559307906 | p00015 | Accepted | n = int(input())
for _ in range(n):
a = sum([int(input()) for _ in range(2)])
print(a if a < 10**80 else 'overflow') | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s003076343 | p00015 | Accepted | for _ in range(int(input())):
a=int(input())+int(input())
print(a if a < 10**80 else 'overflow') | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s098059357 | p00015 | Accepted | n = int(raw_input())
for _ in [0]*n:
a = int(raw_input())
b = int(raw_input())
c = a+b
print [c,"overflow"][len(str(c))>80] | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s812535351 | p00015 | Accepted | n = input()
for _ in [0]*n:
a = input()
b = input()
c = a+b
print [c,"overflow"][len(str(c))>80] | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s958768915 | p00015 | Accepted | import sys
n = int(input())
for i in range(n):
a = int(input())
b = int(input())
if a + b >= 10**80:
print ("overflow")
else:
print(a + b) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s297534833 | p00015 | Accepted | import math
n=input()
for i in range(n):
a=input()
b=input()
ans=a+b
if len(str(ans))>80:
print "overflow"
else:
print ans | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s807284630 | p00015 | Accepted | def f(): return int(raw_input())
n = f()
for _ in [0]*n:
a = f()
b = f()
c = a+b
print [c, "overflow"][len(str(c))>80] | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s959837233 | p00015 | Accepted | n=int(input())
for i in range(n):
a=int(input())
b=int(input())
c=a+b
if len(str(c))>80:
print("overflow")
else:
print(c) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s559262615 | p00015 | Accepted | 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) <= 80 else 'overflow') | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s858975745 | p00015 | Accepted | from sys import stdin
n = int(stdin.readline())
for i in range(n):
c = str(int(stdin.readline().strip()) + int(stdin.readline().strip()))
if (len(c) > 80):
print("overflow")
else:
print(c) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s943602685 | p00015 | Accepted | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright : @Huki_Hara
# Created : 2015-03-05
n=int(input())
for _ in range(n):
a=int(input())
b=int(input())
sum=a+b
if len(str(sum)) > 80:
print("overflow")
else:
print(sum) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s384091244 | p00015 | Accepted | 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
if len(z)==0:
print 0
else:
print ''.join(map(str,z)) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s504132853 | p00015 | Accepted | N=int(raw_input())
for i in range(N):
a=raw_input()
b=raw_input()
if len(a)<len(b):
(a,b)=(b,a)
b=''.join(['0' for x in range(len(a)-len(b))])+b
c=[]
o=0
for p in range(len(a)):
d=(int(a[-p-1])+int(b[-p-1])+o)%10
o=(int(a[-p-1])+int(b[-p-1])+o)/10
c.append(d)
if o:
c.append(o)
c.reverse()
if len(c)<81:
print ''.join([str(x) for x in c])
else:
print 'overflow' | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s908841228 | p00015 | Accepted | a=input()
for i in range(a):
x=input()
y=input()
if len(str(x+y))>80:
print "overflow"
else:
print x+y | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s568388441 | p00015 | Accepted | n = int(raw_input())
while n:
n -= 1
a = long(raw_input())
b = long(raw_input())
c = a + b
if 80 < len(str(c)):
print "overflow"
else:
print c | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s513914175 | p00015 | Accepted | n = input()
for i in range(n):
a = input()
b = input()
c = int(a) + int(b)
if len(str(c)) > 80:
print 'overflow'
else:
print a + b | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s059412097 | p00015 | Accepted | for x in[sum([input(),input()])for i in range(input())]:print"overflow"if len(str(x))>80 else x | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s856329787 | p00015 | Accepted | def main():
n = int(input())
for i in range(n):
result = str(int(input()) + int(input()))
if len(result) > 80:
print("overflow")
else:
print(result)
if __name__ == '__main__':
main() | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s027972645 | p00015 | Accepted | #!/usr/bin/env python
#-*- coding:utf-8 -*-
import sys
import math
n = int(input())
result = 0
for i in range(n):
result = 0
x = int(input())
y = int(input())
result = x + y
length = len(str(result))
if length > 80:
print("overflow")
else:
print(result) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s454976703 | p00015 | Accepted | for _ in range(int(input())) :
n = int(input()) + int(input())
if (n >= 10 ** 80) :
print("overflow")
else :
print(n) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s538397199 | p00015 | Accepted | n = int(input())
over = 10 ** 80
for i in range(n):
a = int(input())
b = int(input())
if (a + b < over):
print (a + b)
else:
print "overflow" | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s367333409 | p00015 | Accepted | max = 10 ** 80
for i in range(int(input())):
total = int(input()) + int(input())
print(total if total < max else "overflow") | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s209687972 | p00015 | Accepted | #!/usr/bin/python
# AOJ
# 0015
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
if len(ans) > 80:
print('overflow')
else:
print(''.join(ans)) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s853827473 | p00015 | Accepted | #!/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; | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s464226030 | p00015 | Accepted | # -*- coding:utf-8 -*-
def main():
for i in range(int(input())):
a=int(input())+int(input())
if a>=10**80:
print("overflow")
else:
print(a)
if __name__ == '__main__':
main() | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s735553026 | p00015 | Accepted | n = int(input())
for i in range(n):
a = int(input())
b = int(input())
if (a + b) < (10 ** 80):
print(a + b)
else:
print("overflow") | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s999967047 | p00015 | Accepted | while True:
try:
n = input()
for i in range(n):
a = input()
b = input()
s = a+b
if len(str(s)) > 80:
print "overflow"
else:
print s
except EOFError:
break | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s882422220 | p00015 | Accepted | n = int(input())
for i in range(n):
a = int(input())
b = int(input())
if (a + b) < (10 ** 80):
print(a + b)
else:
print("overflow") | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s525499679 | p00015 | Accepted | n = int(input())
for i in range(n):
x = int(input())
y = int(input())
if x + y >= 10 ** 80:
print("overflow")
else:
print(x + y) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s510296657 | p00015 | Accepted | import math
n=int(input())
for i in range(n):
fint=int(input())
sint=int(input())
sum=fint+sint
if(sum<pow(10,80)):
print (sum)
else:
print("overflow") | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s568743394 | p00015 | Accepted | n=int(input())
for i in range(n):
a=int(input())
b=int(input())
c=a+b
ss=str(c)
if len(ss)>80:
print("overflow")
else:
print(ss) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s742139484 | p00015 | Accepted | n = int(input())
for _ in range(n):
s = int(input()) + int(input())
print('overflow' if len(str(s)) > 80 else s) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s553144491 | p00015 | Accepted | from functools import reduce
from operator import add
num = int(input())
for _ in range(num):
budget = reduce(add, [int(input()) for _ in range(2)])
if len(str(budget)) > 80:
print('overflow')
else:
print(budget) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s256390157 | p00015 | Accepted | n = input()
for i in xrange(n):
num1 = input()
num2 = input()
if len(str(num1))>80 or len(str(num2))>80:
print "overflow"
continue
ans = num1+num2
if len(str(ans)) > 80:
print "overflow"
else:
print ans | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s171687918 | p00015 | Accepted | l = int(input())
for i in range(l):
a = int(input()) + int(input())
if(len(str(a)) > 80):
print('overflow')
else:
print(a) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s147590026 | p00015 | Accepted | n=int(input())
for _ in range(n):
s=int(input())+int(input())
print('overflow' if len(str(s))>80 else s) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s298557592 | p00015 | Accepted | num_inputs = int(raw_input())
limit = 100000000000000000000000000000000000000000000000000000000000000000000000000000000
count = 0
while count < num_inputs:
num1 = int(raw_input())
num2 = int(raw_input())
if num1 >= limit or num2 >= limit:
print "overflow"
else:
num = num1 + num2
if num >= limit:
print "overflow"
else:
print num
count += 1 | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s664859530 | p00015 | Accepted | # -*- 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" | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s443564738 | p00015 | Accepted | n = int(input())
for i in range(n):
a = int(input())
b = int(input())
s = a + b
if s >= 10**80:
print('overflow')
else:
print(s) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s185890313 | p00015 | Accepted | import math
N = int(input())
for i in range(N):
a = int(input())
b = int(input())
if a >= 10 ** 80 or b >= 10 ** 80 or a + b >= 10 ** 80:
print("overflow")
else:
print(a + b) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s914654238 | p00015 | Accepted | n=input()
for i in xrange(n):
a=0
for j in xrange(2):
a+=input()
if len(str(a))>80:
print('overflow')
else:
print(a) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s434659223 | p00015 | Accepted | 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()
if len(sumstr) == 0:
sumstr = "0"
print(sumstr)
except Overflow:
print("overflow") | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s058171298 | p00015 | Accepted | for i in range(int(input())):
a = int(input())
b = int(input())
if a+b >= 10**80:
print("overflow")
else:
print(a+b) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s513004156 | p00015 | Accepted | for i in range(int(input())):
x = int(input())
y = int(input())
res = x + y
if len(str(res)) > 80:
print("overflow")
else:
print(res) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s571726172 | p00015 | Accepted | n=int(input())
ans_list=[]
for i in range(n):
a=int(input())
b=int(input())
if max(a,b,a+b)>=10**80:
ans_list.append("overflow")
else:
ans_list.append(a+b)
for i in ans_list:
print(i) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s547696876 | p00015 | Accepted | n=int(input())
ans_list=[]
for i in range(n):
a=int(input())
b=int(input())
c=a+b
if max(a,b,c)>=10**80:
ans_list.append("overflow")
else:
ans_list.append(c)
for i in ans_list:
print(i) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s366557235 | p00015 | Accepted | import sys
import re
def line():return sys.stdin.readline().strip()
N = input()
while True:
try:
a = int(line())
b = int(line())
if a + b >= 10 ** 80:
print("overflow")
else:
print(a + b)
except:
break | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s176691991 | p00015 | Accepted | 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) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s842481500 | p00015 | Accepted | 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) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s522762879 | p00015 | Accepted | n = int(input())
for i in range(n):
a = int(input())
b = int(input())
res = a + b
if res >= 10**80:
print("overflow")
else :
print (res) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s142305443 | p00015 | Accepted | a = int(input())
for i in range(a):
x = int(input())
y = int(input())
if x + y >= 10 ** 80:
print("overflow")
else:
print(x + y) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s432352669 | p00015 | Accepted | n = int(input())
for i in range(n):
a = int(input())
b = int(input())
if a + b < 10**80 : print(a + b)
else : print("overflow") | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s990542341 | p00015 | Accepted | N = int(input())
for _ in range(N):
a = int(input())
b = int(input())
if len(str(a+b)) > 80:
print("overflow")
else:
print(a+b) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s285971172 | p00015 | Accepted | n = int(input())
for i in range(n):
a = int(input())
b = int(input())
c = str(a+b)
if len(c) > 80:
print("overflow")
else:
print(c) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s162504173 | p00015 | Accepted | 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(ans) > 80 else ans) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s827571168 | p00015 | Accepted | n = int(input())
for i in range(n):
a = input()
b = input()
c = int(a) + int(b)
if len(a) > 80 or len(b) > 80 or len(str(c)) > 80:
print('overflow')
else:
print(c) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s344466035 | p00015 | Accepted | for _ in range(int(input())):
a = int(input())
b = int(input())
s = a + b
if s >= 10 ** 80:
print('overflow')
else:
print(s) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s281936843 | p00015 | Accepted | N = int(raw_input())
for i in range(N):
a , b = int(raw_input()), int(raw_input())
if a + b > 10 ** 80 - 1:
print "overflow"
else:
print a + b | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s567307563 | p00015 | Accepted | n = int(input())
for i in range(n):
s = int(input())+int(input())
if len(str(s))>80:
print("overflow")
else:
print(s) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s484742651 | p00015 | Accepted | n = input()
limit = 10 ** 80
for i in xrange(n):
result = input() + input()
if result >= limit: print "overflow"
else: print result | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s868595679 | p00015 | Accepted | n=int(input())
for i in range(n):
a=int(input())
b=int(input())
if len(str(a+b))>80:print("overflow")
else:print(a+b) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s843142556 | p00015 | Accepted | # ?????¶??????????±???????????????°??????
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(ans)
if __name__ == '__main__':
main() | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s368879060 | p00015 | Accepted | n = input()
for k in range(n):
a = input()
b = input()
c = int(a) + int(b)
if len(str(c)) > 80:
c = "overflow"
print c | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s362577877 | p00015 | Accepted | 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")
elif result == "":
print(0)
else:
print(result) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s898279862 | p00015 | Accepted | 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") | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s469364302 | p00015 | Accepted | for i in xrange(input()):
a = int(raw_input())
b = int(raw_input())
print a+b if len(str(a+b)) <= 80 else 'overflow' | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s338403177 | p00015 | Accepted | for i in range(int(input())):
a, b = int(input()), int(input())
result = a+b if len(str(a+b))<=80 else 'overflow'
print(result) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s653190317 | p00015 | Accepted | import math
n = input()
for _ in xrange(n):
x = input()
y = input()
z = x + y
if any(map(lambda t: len(str(t)) > 80, [x, y, z])):
print "overflow"
else:
print z | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s084318874 | p00015 | Accepted | def overflow(s):
if len(s) > 80:
print('overflow')
else:
print(s)
def string_sum(la, lb):
d = abs(len(la) - len(lb))
if len(la) > len(lb):
lb = "0" * d + lb
else:
la = "0" * d + la
ls = []
carry = 0
for a, b in zip(la[::-1], lb[::-1]):
s = int(a) + int(b) + carry
ls.append(str(s % 10))
carry = s // 10
if carry == 1:
ls.append('1')
return ''.join(ls[::-1])
n = int(input())
while n > 0:
one = input()
two = input()
overflow(string_sum(one, two))
n -= 1 | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s458098856 | p00015 | Accepted | import sys
import math
n = int(sys.stdin.readline())
for i in range(n):
n1 = int(sys.stdin.readline())
n2 = int(sys.stdin.readline())
if n1+n2<100000000000000000000000000000000000000000000000000000000000000000000000000000000 :
print(n1+n2)
else:
print("overflow") | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s827914623 | p00015 | Accepted | n = int(input())
for i in range(n):
a = int(input())
b = int(input())
if len(str(a + b)) > 80:
print("overflow")
else:
print(a+b) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s596567217 | p00015 | Accepted | upper = 10**80
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") | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s404523256 | p00015 | Accepted | if __name__ == '__main__':
# ??????????????\???
loop = int(input())
for i in range(loop):
num1 = int(input())
num2 = int(input())
# ???????????????
result = num1 + num2
# ???????????????
if len(str(result)) > 80:
print('overflow')
else:
print(result) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
s828040444 | p00015 | Accepted | N=int(input())
a=[None]*N
b=[None]*N
for i in range(0,N):
a[i]=int(input())
b[i]=int(input())
for i in range(0,N):
if len(str(a[i]))>80:
print("overflow")
elif len(str(b[i]))>80:
print("overflow")
elif len(str(a[i]+b[i]))>80:
print("overflow")
else:
print(a[i]+b[i]) | 6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
| 1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
|
<H1>National Budget</H1>
<p>
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.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
</p>
<p>
If given integers or the sum have more than 80 digits, print "overflow".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
</p>
<pre>
The first integer
The second integer
</pre>
<p>
The integer has at most 100 digits.
</p>
<H2>Output</H2>
<p>
For each dataset, print the sum of given integers in a line.
</p>
<H2>Sample Input</H2>
<pre>
6
1000
800
9999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
1
99999999999999999999999999999999999999999999999999999999999999999999999999999999
0
100000000000000000000000000000000000000000000000000000000000000000000000000000000
1
100000000000000000000000000000000000000000000000000000000000000000000000000000000
100000000000000000000000000000000000000000000000000000000000000000000000000000000
</pre>
<H2>Output for the Sample Input</H2>
<pre>
1800
10000000000000000000000000000000000000000
overflow
99999999999999999999999999999999999999999999999999999999999999999999999999999999
overflow
overflow
</pre>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.