Skip to content

Instantly share code, notes, and snippets.

@kg86
Created August 29, 2014 17:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kg86/c5d587610ebdf39aedf0 to your computer and use it in GitHub Desktop.
Save kg86/c5d587610ebdf39aedf0 to your computer and use it in GitHub Desktop.
import sys
if __name__=='__main__':
lines = [int(x.strip()) for x in sys.stdin.readlines() if x != '' and x != '\n']
n = lines[0]
for i in xrange(n):
# a, b = int(lines[i+1]), int(lines[i+2])
a, b = lines[2*i+1], lines[2*i+2]
if len(str(a+b)) > 80:
print 'overflow'
else:
print a+b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment