submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s894954751
p00014
Accepted
while True: try: d = int(input()) ans = 0 for x in range(0,600,d): ans += d*x*x print(ans) except: break
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s850101785
p00014
Accepted
while True: try: d=int(input()) count=0 for i in range(1,int(600/d)): count+=((i*d)**2)*d print(count) except EOFError: break
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s118640510
p00014
Accepted
def process() : d = int(input()) S = 0 n = 600 / d for i in range(1,int(n)) : S += (i * d * i * d) * d print(S) while True : try : process() except EOFError : break
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s732094985
p00014
Accepted
while True: try: d=int(input()) ans=0 for i in range(1,600//d): ans+=d*((i*d)**2) print(ans) except: break
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s869781704
p00014
Accepted
while True: try:d=int(input()) except:break list=[(i*d)**2*d for i in range(600//d)] print(sum(list))
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s340697436
p00014
Accepted
while True: try: d = int(input()) except EOFError: break S = 0 for i in range(d,600,d): S += d * i**2 print(S)
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s311937349
p00014
Accepted
import sys for line in sys.stdin: d = int(line) sum = 0 for i in range(0, (600-d)/d): y = (i+1)*d sum += y*y*d print sum
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s411105827
p00014
Accepted
import sys for d in sys.stdin: a = int(d) print(sum(a * x**2 for x in range(a, 600, a)))
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s141098586
p00014
Accepted
while 1: try: ans=0 d=int(input()) for i in range(1,600//d): ans+=(i*d)**2*d print(ans) except:break
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s263651072
p00014
Accepted
if __name__ == '__main__': while True: ans = 0 try: n = int(input()) for i in range(1, 600//n): ans += ((n*i)**2) * n print(ans) except EOFError: break
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s635598502
p00014
Accepted
while(1): try: n = int(input()) a = list(range(0,600,n)) s = sum([i**2 for i in a])*n print(s) except EOFError: break
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s188457995
p00014
Accepted
while True: try: d = int(input()) sum = 0 for i in range(1, 600//d): sum += d * (d * i) ** 2 print(sum) except EOFError: break
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s963928189
p00014
Accepted
while True: try: d = int(input()) print(sum(d * x**2 for x in range(d, 600, d))) except: break
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s518481390
p00014
Accepted
while(True): try: d = int(input()) r = 0 for p in range(0,600,d): r += d*p**2 print(r) except: break
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s678746964
p00014
Accepted
import sys def f(x): return x**2 def integral(d): s = 0 for _d in range(1, int(600/d)): s += f(d * _d) * d return s def run(): for d in sys.stdin: print(integral(int(d))) if __name__ == '__main__': run()
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s763899296
p00014
Accepted
import sys def Integral(x): return x**2 def test(d): s=0 n=int(600/d) for i in range(1,n): s+=Integral(d*i)*d return s for d in sys.stdin: d=int(d) print(test(d))
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s538688158
p00014
Accepted
while True: try: sums = 0 d = int(input()) n = 600//d for s in range(n): D = d*((s*d)**2) sums += D print(sums) except: break
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s785802218
p00014
Accepted
while 1: try: d=int(input()) ans=0 for i in range(600//d): ans+=d*d*d*i*i print(ans) except:break
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s221128196
p00014
Accepted
while 1: try: d = int(input()) s = 0 for i in range(d,600,d): s += d*i**2 print(s) except: break
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s097002469
p00014
Accepted
# Integral def sumby(d, S=0): for i in range(d, 600, d): S += pow(i,2) * d return S d = int(input()) while 1: print(sumby(d)) try: d = int(input()) except EOFError: break
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s484296134
p00014
Accepted
output = [] while True: try: d = int(input()) except : break sum = 0 for x in range(1,600//d): sum = sum + d * (d*x) * (d*x) output.append(sum) for x in range(len(output)): print(output[x])
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s031227066
p00014
Runtime Error
import sys for d in map(int, sys.stdin): sum = 0 for x in range(d, 600, d): sum += (x**2)*d print s
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s794446180
p00014
Runtime Error
while 1: dd = raw_input() d = int(dd) i = 1 ans = 0 while i * d < 600: ans += (i * d) * (i * d) * d i += 1 print ans
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s038966137
p00014
Runtime Error
import sys a = [] for line in sys.stdin: a.append(line) for n in a: num=int(n) x=0 are=0 while x<600: are+=(x**2)*num x+=num print area
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s650268151
p00014
Runtime Error
import sys def f(x): return x ** 2 def integral(d): s = f(d) * d for i in range(600 // d - 1): s += f(d * (i + 1)) * d return s lines = sys.stdin.readlines() for line in lines: print(integral(line))
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s364715764
p00014
Runtime Error
import math while 1: try: d=int(input()) x=d y=x**2 S=d*y while S<=72000000: x+=d y=x**2 de=72000000-S S+=d*y if de<(S-72000000): print(72000000-de) else: print(S) except EOFError: break
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s867690891
p00014
Runtime Error
while 1: try: d=int(input()) x=d y=x**2 S=d*y while S<=72000000: x+=d y=x**2 de=72000000-S S+=d*y if de<(S-72000000): print(72000000-de) else: print(S) except EOFError: break
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s531274423
p00014
Runtime Error
while 1: try: d=int(input()) if d==0: break x=d y=x**2 S=d*y while S<=72000000: x+=d y=x**2 de=72000000-S S+=d*y if de<(S-72000000): print(72000000-de) else: print(S) except EOFError: break
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s253637740
p00014
Runtime Error
import math while 1: try: d=int(input()) if d>math.sqrt(72000000): print(0) else: S=0 x=d y=x**2 S=d*y while S<=72000000: de=72000000-S x+=d y=x**2 S+=d*y if de<(S-72000000): print(72000000-de) else: print(S) except EOFError: break
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s039204415
p00014
Runtime Error
t = 0 while t == 0: try: d = int(input()) except: break else: print(sum(d * ((i * d) ** 2) for i in range(int(600/d))))
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s636919500
p00014
Runtime Error
while True: d = int(input()) ans = 0 x = d while x < 600: ans += (x**2)*dx += d
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s318197574
p00014
Runtime Error
while True: d = int(input()) ans = 0 x = d while x < 600: ans += (x**2)*dx += d print(ans)
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s853368291
p00014
Runtime Error
while True: try: d = int(input()) except: break ans = 0 x = d while x < 600: ans += (x**2)*dx += d print(ans)
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s994608659
p00014
Runtime Error
import sys S=lambda s:sum([((i*s)**2)*s for i in range(int(600/s))]) [print(S[int(line)]) for line in sys.stdin]
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s316014210
p00014
Runtime Error
while True: d = int(raw_input()) print reduce(lambda x,y:x+y,map(lambda x:d*x*x,range(d, 600, d)))
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s738690890
p00014
Runtime Error
while True: try: d = int(raw_input()) except EOFError: break print reduce(lambda x,y:x+y,map(lambda x:d*x*x,range(d, 600, d)))
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s873961784
p00014
Runtime Error
while True: try: d = int(raw_input()) except EOFError: break rects = map(lambda x:d*x*x,range(d, 600, d)) print reduce(lambda x,y:x+y,rects)
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s830578449
p00014
Runtime Error
while True: d = raw_input() if d != '': size = 0 d = int(d) fd = d for x in range(1,600/d): size += d*(fd**2) fd += d print size continue else: break
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s984757633
p00014
Runtime Error
import sys for line in sys.stdin: result =, 0 d = int(line) x = d while x < 600: result += x**2 * d print result
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s553611017
p00014
Runtime Error
import sys for d in sys.stdin: print sum([d*x*x for x in range(d,600,d)])
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s755230377
p00014
Runtime Error
import sys for d in int(sys.stdin): print sum([d*x*x for x in range(d,600,d)])
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s160010468
p00014
Runtime Error
#include <stdio.h> int main(void) { int i,d,S; while (scanf("%d",&d)!=EOF){ S=0; for (i=0;i<600;i+=d){ S+=d*pow(i,2); } printf("%d\n",S); } return 0; }
20 10
68440000 70210000
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Integral</H1> <p> Write a program which computes the area of a shape represented by the following three lines:<br/> <br/> $y = x^2$<br/> $y = 0$<br/> $x = 600$<br/> <br/> <!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>--> </p> <p> It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure: </p> <center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/> $f(x) = x^2$<br/> <br/> </center> <!-- <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2"> </center> --> <p> The approximative area $s$ where the width of the rectangles is $d$ is:<br/> <br/> area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/> area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/> ...<br/> area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/> </p> <p> The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$. </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> For each dataset, print the area $s$ in a line. </p> <H2>Sample Input</H2> <pre> 20 10 </pre> <H2>Output for the Sample Input</H2> <pre> 68440000 70210000 </pre>
s978923691
p00015
Wrong Answer
n=int(input()) for i in range(n): a=int(input()) b=int(input()) if a+b>=10**79:print("overflow") else:print(a+b)
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 &le; <var>N</var> &le; 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>
s480705666
p00015
Wrong Answer
# python template for atcoder1 import sys sys.setrecursionlimit(10**9) input = sys.stdin.readline n = int(input()) ans = [] for _ in range(n): a = int(input()) b = int(input()) s = a+b if s >= 10**79: ans.append("overflow") else: ans.append(str(s)) print("\n".join(ans))
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 &le; <var>N</var> &le; 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>
s149055731
p00015
Wrong Answer
for i in range(int(input())): n1 = list(input()) n2 = list(input()) if len(n2) > len(n1): n1, n2 = n2, n1 ans = [] for i in range(len(n1)): a = int(ans.pop(0)) if len(ans) == i + 1 else 0 c1 = int(n1.pop(-1)) c2 = int(n2.pop(-1)) if len(n2) != 0 else 0 ans = list(str(a + c1 + c2)) + ans print(''.join(ans))
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 &le; <var>N</var> &le; 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>
s753370450
p00015
Wrong Answer
if __name__ == "__main__": nset = int(input()) for i in range(0,nset): a = int(input()) b = int(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 &le; <var>N</var> &le; 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>
s097271967
p00015
Wrong Answer
import math n1 = input(); n2 = input(); sum = int(n1) + int(n2); if int(math.log10(sum)) + 1 >= 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 &le; <var>N</var> &le; 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>
s192581793
p00015
Wrong Answer
import math n1 = input(); n2 = input(); sum = int(n1) + int(n2); if int(math.log10(sum)) + 1 > 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 &le; <var>N</var> &le; 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>
s728017364
p00015
Wrong Answer
import math n1 = input(); n2 = input(); sum = int(n1) + int(n2); if int(math.log10(sum)) + 1 > 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 &le; <var>N</var> &le; 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>
s501163021
p00015
Wrong Answer
n = input() for i in range(n): a = input() b = 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 &le; <var>N</var> &le; 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>
s831868700
p00015
Wrong Answer
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 &le; <var>N</var> &le; 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>
s261628215
p00015
Wrong Answer
n=int(input()) for i in range(n): a=int(input()) b=int(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 &le; <var>N</var> &le; 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>
s451680545
p00015
Wrong Answer
import math a=int(input()) b=int(input()) c=a+b for x in range(80): c=math.floor(c/10) if(c>=1): print("overflow") else: print(a+b)
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 &le; <var>N</var> &le; 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>
s831622229
p00015
Wrong Answer
n=int(input()) for n in range(n): a=int(input()) b=int(input()) c=a+b if c>=int(1e79): print("overflow") else: print(c)
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 &le; <var>N</var> &le; 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>
s496159665
p00015
Wrong Answer
n=int(input()) for n in range(n): a=int(input()) b=int(input()) c=a+b if c>=int(1e80): print("overflow") else: print(c)
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 &le; <var>N</var> &le; 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>
s194661465
p00015
Wrong Answer
n=int(input()) for n in range(n): a=int(input()) b=int(input()) c=a+b if a>=int(1e79) or b>=int(1e79) or c>=int(1e79): print("overflow") else: print(c)
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 &le; <var>N</var> &le; 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>
s692007952
p00015
Wrong Answer
n=int(input()) for n in range(n): a=int(input()) b=int(input()) c=a+b if a>=int(1e80) or b>=int(1e80) or c>=int(1e80): print("overflow") else: print(c)
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 &le; <var>N</var> &le; 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>
s828038251
p00015
Wrong Answer
n=int(input()) for i in range(n): a=int(input()) b=int(input()) c=a+b if a>=int(1e80) or b>=int(1e80) or c>=int(1e80): print("overflow") else: print(c)
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 &le; <var>N</var> &le; 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>
s747734191
p00015
Wrong Answer
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 &le; <var>N</var> &le; 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>
s149866897
p00015
Wrong Answer
n = int(input()) for _ in range(n): a = sum([int(input()) for _ in range(2)]) if len(str(a)) < 80: print(a) else: print('overflow')
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 &le; <var>N</var> &le; 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>
s064213588
p00015
Wrong Answer
n = int(input()) for _ in range(n): a, b = input(), input() m = abs(len(a) - len(b)) if len(a) > len(b): a = '0' + a b = '0' * (m+1) + b else: a = '0' * m + a b = '0' + b a, b = a[::-1], b[::-1] budget = [] flag = False for i in range(0, len(a), 10): t = int(a[i:i+10][::-1]) + int(b[i:i+10][::-1]) if flag: t += 1 t = str(t) if len(t) > 10: t = t[1:] flag = True elif i + 10 <= len(a): t = '0' * abs(len(t) - 10) + t flag = False else: flag = False budget.append(t) print(''.join(budget[::-1]))
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 &le; <var>N</var> &le; 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>
s247796105
p00015
Wrong Answer
n = int(input()) for _ in range(n): a, b = input(), input() m = abs(len(a) - len(b)) if len(a) > len(b): a = '0' + a b = '0' * (m+1) + b else: a = '0' * m + a b = '0' + b a, b = a[::-1], b[::-1] budget = [] flag = False for i in range(0, len(a), 10): t = int(a[i:i+10][::-1]) + int(b[i:i+10][::-1]) if flag: t += 1 t = str(t) if len(t) > 10: t = t[1:] flag = True elif i + 10 < len(a): t = '0' * abs(len(t) - 10) + t flag = False else: flag = False budget.append(t) print(''.join(budget[::-1]))
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 &le; <var>N</var> &le; 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>
s199845182
p00015
Wrong Answer
n = int(input()) for _ in range(n): a, b = input(), input() m = abs(len(a) - len(b)) if len(a) > len(b): a = '0' + a b = '0' * (m+1) + b else: a = '0' * m + a b = '0' + b a, b = a[::-1], b[::-1] budget = [] flag = False for i in range(0, len(a), 10): t = int(a[i:i+10][::-1]) + int(b[i:i+10][::-1]) if flag: t += 1 t = str(t) if len(t) > 10: t = t[1:] flag = True elif i + 10 < len(a): t = '0' * abs(len(t) - 10) + t flag = False else: flag = False budget.append(t) budget = ''.join(budget[::-1]) if len(budget) < 80: print(''.join(budget[::-1])) else: print('overflow')
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 &le; <var>N</var> &le; 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>
s473106047
p00015
Wrong Answer
n = int(input()) for _ in range(n): a, b = input(), input() m = abs(len(a) - len(b)) if len(a) > len(b): a = '0' + a b = '0' * (m+1) + b else: a = '0' * m + a b = '0' + b a, b = a[::-1], b[::-1] budget = [] flag = False for i in range(0, len(a), 10): t = int(a[i:i+10][::-1]) + int(b[i:i+10][::-1]) if flag: t += 1 t = str(t) if len(t) > 10: t = t[1:] flag = True elif i + 10 < len(a): t = '0' * abs(len(t) - 10) + t flag = False else: flag = False budget.append(t) budget = ''.join(budget[::-1]) if len(budget) < 80: print(budget) else: print('overflow')
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 &le; <var>N</var> &le; 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>
s793315915
p00015
Wrong Answer
n = int(input()) for _ in range(n): a, b = input(), input() m = abs(len(a) - len(b)) if len(a) > len(b): a = '0' + a b = '0' * (m+1) + b else: a = '0' * m + a b = '0' + b a, b = a[::-1], b[::-1] budget = [] flag = False for i in range(0, len(a), 10): t = int(a[i:i+10][::-1]) + int(b[i:i+10][::-1]) if flag: t += 1 t = str(t) if len(t) > 10: t = t[1:] flag = True elif i + 10 <= len(a): t = '0' * abs(len(t) - 10) + t flag = False else: flag = False budget.append(t) budget = ''.join(budget[::-1]) if len(budget) < 80: print(budget) else: print('overflow')
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 &le; <var>N</var> &le; 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>
s655732998
p00015
Wrong Answer
import sys a = int(input()) b = int(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 &le; <var>N</var> &le; 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>
s365206720
p00015
Wrong Answer
import sys f = sys.stdin n = int(f.readline()) for _ in range(n): a = f.readline().strip() b = f.readline().strip() c = int(a) + int(b) c = '{}'.format(c) print(c if len(c) else 'overflow ')
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 &le; <var>N</var> &le; 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>
s386357163
p00015
Wrong Answer
import sys f = sys.stdin n = int(f.readline()) for _ in range(n): a = f.readline().strip() b = f.readline().strip() c = int(a) + int(b) c = '{}'.format(c) print(c if len(c) else 'overflow')
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 &le; <var>N</var> &le; 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>
s482303537
p00015
Wrong Answer
for x in range(input()): x=raw_input() x=x[::-1] y=raw_input() y=y[::-1] z=[0]*81 if len(x)>80 or len(y) >80: print 'overflow' else: for i in xrange(len(x)): z[i]=int(x[i]) for j in xrange(len(y)): z[j]=z[j]+int(y[j]) for k in xrange(max(len(x),len(y))): sum=z[k] z[k]=sum%10 z[k+1]+=sum/10 z.reverse() if z[0]!=0: print 'overflow' else: for j in xrange(len(z)): if z[0]==0: z.pop(0) else: break print ''.join(map(str,z))
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 &le; <var>N</var> &le; 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>
s101602716
p00015
Wrong Answer
a=input() for i in range(2): x=input() y=input() 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 &le; <var>N</var> &le; 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>
s003096855
p00015
Wrong Answer
n = int(raw_input()) while n: n -= 1 a = long(raw_input()) b = long(raw_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 &le; <var>N</var> &le; 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>
s481115840
p00015
Wrong Answer
n = int(raw_input()) while n: n -= 1 a = long(raw_input()) b = long(raw_input()) print str(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 &le; <var>N</var> &le; 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>
s474448517
p00015
Wrong Answer
for x in[sum([input(),input()])for i in range(input())]:print 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 &le; <var>N</var> &le; 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>
s656748883
p00015
Wrong Answer
def main(): n = int(input()) for i in range(n): val1 = int(input()) val2 = int(input()) print(str(val1 + val2)) 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 &le; <var>N</var> &le; 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>
s763462609
p00015
Wrong Answer
print("In preparation.")
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 &le; <var>N</var> &le; 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>
s537102298
p00015
Wrong Answer
#!/usr/bin/env python #-*- coding:utf-8 -*- import sys import math n = int(input()) for _ in range(n): x = int(input()) y = int(input()) print(x+y)
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 &le; <var>N</var> &le; 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>
s762563140
p00015
Wrong Answer
#!/usr/bin/env python #-*- coding:utf-8 -*- import sys import math n = int(input()) anss = [] for _ in range(n): x = int(input()) y = int(input()) anss.append(x+y) for data in anss: print(data)
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 &le; <var>N</var> &le; 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>
s448928860
p00015
Wrong Answer
#!/usr/bin/env python # -*- coding: utf-8 -*- n = int(raw_input()); for i in range(0, n): a = int(raw_input()); b = int(raw_input()); print a + b;
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 &le; <var>N</var> &le; 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>
s191857617
p00015
Wrong Answer
#!/usr/bin/env python # -*- coding: utf-8 -*- n = int(raw_input()); for i in range(0, n): a = long(raw_input()); b = long(raw_input()); print a + b;
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 &le; <var>N</var> &le; 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>
s057060907
p00015
Wrong Answer
#!/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 &le; <var>N</var> &le; 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>
s591206348
p00015
Wrong Answer
# -*- coding:utf-8 -*- def main(): LIST=[] for i in range(int(input())): a=int(input()) b=int(input()) LIST.append(a+b) if len(LIST)>80: print("overflow") break for v in LIST: print(v) if __name__ == '__main__': main()
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 &le; <var>N</var> &le; 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>
s847575027
p00015
Wrong Answer
# -*- coding:utf-8 -*- def main(): LIST=[] for i in range(int(input())): a=int(input()) b=int(input()) LIST.append(a+b) if len(LIST)>80: print("overflow") break for v in LIST: print(str(v)) if __name__ == '__main__': main()
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 &le; <var>N</var> &le; 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>
s285836612
p00015
Wrong Answer
# -*- coding:utf-8 -*- def main(): for i in range(int(input())): a=str(int(input())+int(input())) if len(a)>80: print("overflow") break print(a) if __name__ == '__main__': main()
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 &le; <var>N</var> &le; 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>
s635686214
p00015
Wrong Answer
# -*- coding:utf-8 -*- def main(): for i in range(int(input())): a=int(input())+int(input()) if a>=10**80: print("overflow") print(a) if __name__ == '__main__': main()
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 &le; <var>N</var> &le; 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>
s379504007
p00015
Wrong Answer
n = int(input()) for i in range(n): a = int(input()) b = int(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 &le; <var>N</var> &le; 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>
s026414976
p00015
Wrong Answer
while True: try: n = input() for i in range(n): a = input() b = input() print a+b 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 &le; <var>N</var> &le; 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>
s298837505
p00015
Wrong Answer
n=int(input()) for i in range(n): a=input() if a==1: break b=input() print(str(a)+str(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 &le; <var>N</var> &le; 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>
s486149708
p00015
Wrong Answer
n = input() for i in xrange(n): num1 = input() if len(str(num1))>80: print "overflow" break num2 = input() if len(str(num2))>80: print "overflow" break ans = num1+num2 if len(str(ans)) > 80: print "overflow" else: print ans
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 &le; <var>N</var> &le; 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>
s122283938
p00015
Wrong Answer
n = input() for i in xrange(n): num1 = input() if len(str(num1))>=80: print "overflow" break num2 = input() if len(str(num2))>=80: print "overflow" break ans = num1+num2 if len(str(ans)) >= 80: print "overflow" else: print ans
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 &le; <var>N</var> &le; 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>
s097982746
p00015
Wrong Answer
n = input() for i in xrange(n): num1 = input() if len(str(num1))>80: print "overflow" continue num2 = input() if len(str(num2))>80: print "overflow" continue ans = num1+num2 if len(str(ans)) > 80: print "overflow" else: print ans
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 &le; <var>N</var> &le; 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>
s579602676
p00015
Wrong Answer
n = input() for i in xrange(n): num1 = input() if len(str(num1))>=80: print "overflow" continue num2 = input() if len(str(num2))>=80: print "overflow" continue ans = num1+num2 if len(str(ans)) >= 80: print "overflow" else: print ans
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 &le; <var>N</var> &le; 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>
s076927730
p00015
Wrong Answer
n = input() for i in xrange(n): num1 = input() # if len(str(num1))>80: # print "overflow" # continue num2 = input() # if len(str(num2))>80: # print "overflow" # continue ans = num1+num2 # if len(str(ans)) > 80: # print "overflow" # else: # print ans print ans
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 &le; <var>N</var> &le; 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>
s614688576
p00015
Wrong Answer
N = input(); for i in range(N): s1 = raw_input() s2 = raw_input() if len(s1) > len(s2): l2 = list(s1) l1 = list(s2) else: l1 = list(s1) l2 = list(s2) l1.reverse() l2.reverse() for j in range(len(l1), len(l2)): l1.append("0") lst = [0] for j in range(len(l2)): lst[j] += (int(l1[j]) + int(l2[j])) % 10 lst.append((int(l1[j]) + int(l2[j])) // 10) lst[j] = str(lst[j]) else: lst[len(lst)-1] = str(lst[len(lst)-1]) lst.reverse() if lst[0] == "0": lst.reverse() lst.pop() lst.reverse() print "".join(lst)
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 &le; <var>N</var> &le; 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>
s700903387
p00015
Wrong Answer
N = input(); for i in range(N): s1 = raw_input() s2 = raw_input() if len(s1) > len(s2): l2 = list(s1) l1 = list(s2) else: l1 = list(s1) l2 = list(s2) l1.reverse() l2.reverse() for j in range(len(l1), len(l2)): l1.append("0") lst = [0] for j in range(len(l2)): lst[j] += (int(l1[j]) + int(l2[j])) % 10 lst.append((int(l1[j]) + int(l2[j])) // 10) lst[j] = str(lst[j]) else: lst[len(lst)-1] = str(lst[len(lst)-1]) lst.reverse() if lst[0] == "0": lst.reverse() lst.pop() lst.reverse() print "".join(lst) if len(lst) <= 80 else "overflow"
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 &le; <var>N</var> &le; 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>
s616405815
p00015
Wrong Answer
l = int(input()) for i in range(l): a = int(input()) + int(input()) if(a >= 1E79): 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 &le; <var>N</var> &le; 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>
s511020848
p00015
Wrong Answer
l = int(input()) for i in range(l): a = int(input()) + int(input()) if(a >= 1E80): 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 &le; <var>N</var> &le; 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>
s311641857
p00015
Wrong Answer
l = int(input()) for i in range(l): a = int(input()) + int(input()) if(a > 1E80): 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 &le; <var>N</var> &le; 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>
s591229810
p00015
Wrong Answer
n=int(input()) A=[] while True: try: x=int(input()) A.append(x) except EOFError: break start=0 end=start+n for i in range(len(A)//n): print(sum(A[start:end])) start+=n end+=n
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 &le; <var>N</var> &le; 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>
s791631829
p00015
Wrong Answer
n=int(input()) A=[] while True: try: x=int(input()) A.append(x) except EOFError: break start=0 end=start+n for i in range(len(A)//n): s=sum(A[start:end]) if s/1e80>1: print("overflow") else: print(s) start+=n end+=n
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 &le; <var>N</var> &le; 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>
s874429214
p00015
Wrong Answer
n=int(input()) for _ in range(n): s=int(input())+int(input()) print('overflow' if s/1e80>1 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 &le; <var>N</var> &le; 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>