Go: package main

import (
	"bufio"
	"fmt"
	"math/big"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Scan()
	dataset, _ := strconv.Atoi(sc.Text())
	var firstdata *big.Int

	for i := 0; i < dataset*2; i++ {
		n := new(big.Int)
		sc.Scan()
		data, _ := n.SetString(sc.Text(), 10)

		if i%2 == 0 {
			firstdata = data
			continue
		}

		result := new(big.Int)
		if result := result.Add(data, firstdata); len(result.String()) > 80 {
			fmt.Println("overflow")
			continue
		} else {
			fmt.Println(result)
		}
	}
}

C++: #include<stdio.h>
#include<string.h>
#include<stdlib.h>

int main(){
	char a[800],b[800],wa[801],count;
	int N,i,ea,eb,c;
	
	scanf("%d",&N);
	while(N--){
		scanf(" %s ",a);
		scanf(" %s ",b);
		
		for(i=0;i<800;i++){
			if(a[i]=='\0')break;
		}
		ea=i;
		for(i=0;i<800;i++){
			if(b[i]=='\0')break;
		}
		eb=i;
		c=(ea<eb ? eb:ea);
		memset(wa,'0',sizeof(wa));
		wa[c+1]='\0';
		count=0;
		if(ea>eb){
			for(i=ea-1;i>=ea-eb;i--){
				wa[i+1]=a[i]-'0'+b[i-ea+eb]+count;
				count=0;
				if(wa[i+1]>=58){
					wa[i+1]=wa[i+1] - 10;
					count=1;
				}

			}
			
			for(i=ea-eb-1;i>=0;i--){
				wa[i+1]=a[i]+count;
				count=0;
				if(wa[i+1]>'9'){
					wa[i+1]=wa[i+1]-10;
					count=1;
				}
			}
		}else{
			for(i=eb-1;i>=eb-ea;i--){
				wa[i+1]=b[i]+a[i-eb+ea]+count-'0';
				count=0;
				if(wa[i+1]>=58){
					wa[i+1]=wa[i+1]-10;
					count=1;
				}

			}
			for(i=eb-ea-1;i>=0;i--){
				wa[i+1]=b[i]+count;
				count=0;
				if(wa[i+1]>'9'){
					wa[i+1]=wa[i+1]-10;
					count=1;
				}
			}
		}
		wa[0]=count+'0';
		if(wa[0]=='0'){
			for(i=0;i<=c;i++){
				wa[i]=wa[i+1];
			}
			c=c-1;
		}
		if(c>79){
			printf("overflow\n");
		}else{
			printf("%s\n",wa);
		}
	}
	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <cmath>
using namespace std;

int main()
{
	int n;
	cin >> n;
	for(int i=0;i<n;i++){
		int p1[100],p2[100];
		for(int i=0;i<100;i++){
			p1[i] = 0; p2[i] = 0;
		}
		string a,b;
		cin >> a ;
		cin >> b ;
		if(a.size() > 80 || b.size() > 80){
			cout << "overflow" << endl;
			continue;
		}

		int pos = 0;
		for(unsigned i=a.size();i>0;i--){
			stringstream sst;
			sst << a[i-1];
			sst >> p1[pos++];
		}
		pos = 0;
		for(unsigned i=b.size();i>0;i--){
			stringstream sst;
			sst << b[i-1];
			sst >> p2[pos++];
		}
		for(int i=0;i<100;i++){
			int ans = p1[i]+p2[i];
			p1[i] = ans % 10;
			p1[i+1] += ans/10;
		}
		bool flag = true;
		for(int i=99;i>=0;i--){
			if(flag){
				if(i != 0 && p1[i] == 0)
					continue;
				else{
					if(i > 79){
						cout << "overflow" ;
						break;
					}
					flag = false;
				}
			}
			cout << p1[i];
		}
		cout << endl;
	}
	return 0;
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <string>
#include <stack>

using namespace std;

int main(void){
	int n = 0;
	char i1[100], i2[100], o[100];
	string si1, si2;
	int l1, l2;
	int t=0, c=0;
	stack<char> sum;

	scanf("%d", &n);
	for(int i=0; i<n; ++i){
		scanf("%s", i1);
		scanf("%s", i2);
		si1 = string(i1);
		si2 = string(i2);
		l1 = si1.size();
		l2 = si2.size();

		if(l1 > 80 || l2 > 80){
			puts("overflow");
			continue;
		}

		--l1;
		--l2;
		c = 0;
		sum = stack<char>();
		while(l1 >= 0 || l2 >= 0){
			t = c;
			if(l1 >= 0){ t += (si1[l1] - '0'); }
			if(l2 >= 0){ t += (si2[l2] - '0'); }
			c = t / 10;
			t -= c * 10;
			sum.push((char)(t + '0'));
			--l1;
			--l2;
		}
		if(c == 1){ sum.push((char)(c + '0')); }
		if(sum.size() > 80){
			puts("overflow");
			continue;
		}
		while(!sum.empty()){
			printf("%c", sum.top());
			sum.pop();
		}
		printf("\n");
	}
	return 0;
}

C++: def first_digit(n)
  n[0]
end

def digit(n)
  n.size
end

def overflow?(a, b)
  if digit(a) > 80 || digit(b) > 80
    puts 'overflow'
    return true
  end

  if digit(a) == 80 && digit(b) == 80
    if [a, b].map { |e| first_digit(e).to_i }.inject(:+) >= 10
      puts 'overflow'
      return true
    end
  end

  false
end

input = STDIN.read.split("\n").map(&:chomp)
input.shift.to_i.times do
  a = input.shift
  b = input.shift
  next if overflow?(a, b)
  puts [a, b].map(&:to_i).inject(:+)
end

C++: #include <cstdio>
#include <iostream>
#include <vector>
#include <cstring>
using namespace std;

int main(){
	int n;
	cin >> n;
	while( n-- > 0 ){
		string num1, num2;
		cin >> num1 >> num2;
		/*if( num1.size() > 80 || num2.size() > 80 ){
			cout << "overflow" << endl;
			continue;
		}
		*/
		vector<int> sum;
		int degit = 0;
		for( int i = 0; i <= max(num1.size(), num2.size()); i++ ) sum.push_back(0);
		for( int i = 0; i < num1.size(); i++ ){
			sum[sum.size()-i] = num1[num1.size()-i-1]-'0';
		}
		int d;
		for( int i = 0; i < num1.size() || i < num2.size() || degit != 0; i++ ){
			int now;
			if( i < num2.size() ){
				now = sum[sum.size()-i] + (int)num2[num2.size()-i-1]-(int)('0') + degit;
			}else{
				now = sum[sum.size()-i] + degit;
			}
			sum[sum.size()-i] = (now%10);
			if( now >= 10 ) degit = 1;
			else degit = 0;
			d = i;
		}
		if( d < 80 ){
			for( int i = sum.size()-d; i <= sum.size(); i++ ) cout << sum[i];
			cout << endl;
		}else{
			cout << "overflow" << endl;
		}
	}
}

C++: #include <iostream>
#include <string>

using namespace std;

int main () {
    int n;
    string a, b;
    
    cin >> n;
    for(int i=0;i<n;i++){
        int x[81]={0}, y[81]={0}, z[81]={0};
        
        cin >> a;
        cin >> b;
        
        reverse(a.begin(), a.end());
        reverse(b.begin(), b.end());
        
        for(int j=0;j<a.size();j++){
            x[j]=a[j]-'0';
        }
        for(int j=0;j<b.size();j++){
            y[j]=b[j]-'0';
        }
        
        for(int j=0;j<80;j++){
            z[j]+=x[j]+y[j];
            if(z[j]>=10){
                z[j+1]=1;
                z[j]-=10;
            }
        }
        
        if(z[80]>0){
            cout << "overflow" <<endl;
        }else{
            bool flag = 0;
            for(int j=79;j>=0;j--){
                if(z[j]==0 && flag==0){
                    continue;
                }else{
                    flag=1;
                }
                cout<<z[j];
            }
            if(flag==0){
                cout<<0;
            }
            cout<<endl;
            
        }
    }
    return 0;
}

C++: #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;

//// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\b.txt"


int main() {
	int N; cin >> N;
	while (N--) {

		string a, b; cin >> a >> b;
		vector<int>v(101);
		for (int i = 0; i < a.size(); ++i) {
			v[101 - a.size() + i] = a[i] - '0';
		}
		for (int i = 0; i < b.size(); ++i) {
			v[101 - b.size() + i] += b[i] - '0';
		}
		for (int i = 100; i > 0; --i) {
			if (v[i] >= 10) {
				v[i - 1]++;
				v[i] -= 10;
			}
		}
		int num = 0;
		num = find_if(v.begin(), v.end(), [](const int a) {return a; })-v.begin();
		if (num <= 20)cout << "overflow" << endl;
		else {
			for (int i = num; i < 101; ++i) {
				cout << v[i];
			}
			cout << endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main(){
  int c,d;
  cin >>c;
  int n[81];
  string a,b;
  for(;c>0;c--){
    for(int i=0;i<81;i++) n[i] = 0;
    cin >>a>>b;
    for(int i=0;i<min((int)a.size(),80);i++)n[i] = (int)(a[a.size()-i-1]-'0');
    for(int i=0;i<min((int)b.size(),80);i++)n[i] += (int)(b[b.size()-i-1]-'0');
    for(int i=0;i<80;i++){
      if(n[i]>=10){
	n[i+1]+=n[i]/10;
	n[i]%=10;
      }
    }
    if (a[80]>0||a.size()>80||b.size()>80)
      cout << "overflow" << endl;
    else{
      d = 80;
      while(!n[d])d--;
      for(;d>=0;d--)
	cout << n[d];
      cout << endl;
      }
  }
  return 0;
}