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 <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <queue>
#include <map>
#include <fstream>
#include <array>
#include <utility>
#include <functional>
#include <stack>

using namespace std;
typedef long long Int;
#define REP(i , x) for(int i = 0 ; i < x ; ++i)

typedef pair<int, int> P;


int main()
{
	int n;
	string a, b;
	cin >> n;
	REP(i, n){
		int a_a[85] = { 0 };
		int b_a[85] = { 0 };
		int c_a[85] = { 0 };
			cin >> a >> b;
			if (a.length() >= 80 || b.length() >= 80){
				cout << "overflow" << endl;
			}

			REP(i, a.length()){
				a_a[i] = a[a.length() - i -1] - '0';
			}
			
			REP(i, b.length()){
				b_a[i] = b[b.length() - i -1] - '0';
			}

			REP(i, 84){
				int temp = a_a[i] + b_a[i] + c_a[i];
				c_a[i + 1] += temp / 10;
				c_a[i] = temp % 10;
			}
			int i = 84;
			while (!c_a[i])--i;
			if (i >= 80){
				cout << "overflow" << endl;
			}
			while (i >= 0){
				cout << c_a[i];
				--i;
			}
			cout << endl;
		}
	return 0;
}

C++: #include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
int main(){
  int n;
  char a[101];
  char b[101];
  int temp;
  int p = 0;
  int i;
  int flag;
  cin >> n;
  while(p < n){
    flag = 0;
    for(i = 0;i < 101;i++){
      a[i] = '0';
      b[i] = '0';
    }
    scanf("%s %s",a,b);
    temp = 100;
    for(i = strlen(a) - 1;i >= 0;i--){
      a[temp] = a[i];
      a[i] = '0';
      temp--;
    }
    temp = 100;
    for(i = strlen(b) - 1;i >= 0;i--){
      b[temp] = b[i];
      b[i] = '0';
      temp--;
    }
    for(i = 100;i >= 0;i--){
      a[i] += b[i] - '0';
      if(a[i] > '9'){
	a[i - 1]++;
	a[i] -= 10;
      }
    }
    for(i = 0;i < 101;i++){
      if(a[i] >= '1'){
	if(i <= 20){
	  cout << "overflow";
	  break;
	}
	flag = 1;
      }
      if(flag || i == 100){
	cout << a[i];
      }
    }
    cout << endl;
    p++;
  }
  return(0);
}

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

using namespace std;

int main(){
	int n,l1,l2,i;
	string a, b;
	char *ans;
	int ia,ib,sum;
	cin>>n;
	while(n--){
		cin>>a>>b;
		if(a.length()>80 || b.length()>80){
			cout<<"overflow"<<endl;
			continue;
		}
		if(a.length()==80 || b.length()==80){
			if((int)a[0]-'0'+(int)b[0]-'0'>9){
				cout<<"overflow"<<endl;
				continue;
			}
		}
		if(a.length()<b.length()){
			swap(a,b);
		}
		l1=a.length();
		l2=b.length();
		ans=new char[l1+1];
		for(i=0;i<l1;i++)ans[i]='0';
		for(i=1;i<l2+1;i++){
			ia=(int)a[l1-i]-(int)'0';
			ib=(int)b[l2-i]-(int)'0';
			sum=ia+ib;
			ans[l1-i]+=sum;
		}
		for(i=l2+1;i<l1+1;i++){
			ans[l1-i]=a[l1-i];
		}
		for(i=0;i<l1;i++){
			if(ans[i]-'0'>9){
				ans[i]=ans[i]-10;
				ans[i-1]+=1;
			}
		}
		for(i=0;i<l1;i++){
			cout<<(int)ans[i]-'0';
		}
		cout<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
	string a,b;
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a>>b;
		if(a.size()>80||b.size()>80)
			cout<<"overflow"<<endl;
		else{
			int t;
			int c[100]={0};
			if(a.size()>=b.size())
				t=a.size();
			if(a.size()<b.size())
				t=b.size();
			for(int j=0;j<t;j++){
				if(j<a.size())
					c[j]+=a[a.size()-j-1]-'0';
				if(j<b.size())
					c[j]+=b[b.size()-j-1]-'0';
				if(c[j]>=10){
					c[j]-=10;
					c[j+1]=1;
				}
			}
			bool h=true;
			if(c[t]==1){
				if(t==80){
					cout<<"overflow"<<endl;
					h=false;
				}
				else
				    cout<<"1";
			}
			if(h==true){
			for(int j=t-1;j>=0;j--)
				cout<<c[j];
			cout<<endl;
			}
		}
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdlib>
#define DIGIT 80
using namespace std;

class largenum{
  int nums[DIGIT];
  bool overflow;
  int most;
public:
  largenum(){
    overflow=false;
    most=DIGIT-1;
    for(int i=0;i<DIGIT;i++)
      nums[i]=0;
  }
  bool isoverflow(){ return overflow;}
  friend ostream& operator<<(ostream &out,largenum &l);
  friend istream& operator>>(istream &is,largenum &l);
  friend largenum operator+(largenum l1,largenum l2);
};

largenum operator+(largenum l1,largenum l2){
  bool carry=false;
  largenum ans;
  for(int i=DIGIT-1;i>=0;i--){
    int tmp=l1.nums[i]+l2.nums[i]+carry;
    carry=bool((tmp)/10);
    ans.nums[i]=(tmp)%10;
  }
  for(int i=0;i<DIGIT;i++){
    if(ans.nums[i]!=0){
      ans.most=i;
      break;
    }
  }  
  ans.overflow=carry;
  return ans;
}

ostream& operator<<(ostream &out,largenum &l){
  for(int i=l.most;i<DIGIT;i++){
    out<<l.nums[i];
  }
  return out;
}

istream& operator>>(istream &is,largenum &l){
  string str;
  is>>str;
  if(str.size()>DIGIT){
    l.overflow=true;
  }else{
    for(int i=0;i<(int)str.size();i++){
      int index = DIGIT-str.size()+i;
      switch(str[i]){
      case '0':
	l.nums[index]=0;
	break;
      case '1':
	l.nums[index]=1;
	break;
      case '2':
	l.nums[index]=2;
	break;
      case '3':
	l.nums[index]=3;
	break;
      case '4':
	l.nums[index]=4;
	break;
      case '5':
	l.nums[index]=5;
	break;
      case '6':
	l.nums[index]=6;
	break;
      case '7':
	l.nums[index]=7;
	break;
      case '8':
	l.nums[index]=8;
	break;
      case '9':
	l.nums[index]=9;
	break;
      }
    }
    
    l.most=DIGIT-str.size();
  }
  return is;
}

int main(){
  int num;
  cin>>num;
  while(num--){
    largenum a,b;
    cin>>a>>b;
    if(a.isoverflow() || b.isoverflow()){
      cout<<"overflow"<<endl;
      continue;
    }
    a = a+b;
    if(a.isoverflow()){
      cout<<"overflow"<<endl;
    }else{
      cout<<a<<endl;
    }
  }
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
typedef vector <int> VI;

VI string_to_vi( string number )
{
	VI converted( number.size() );
	for ( int i = 0; i < number.size(); i++ ) converted[i] = (int)( number[i] - '0' );
	return converted;
}

VI add( VI left, VI right )
{
	VI result;
	reverse( left.begin(), left.end() );
	reverse( right.begin(), right.end() );
	VI::iterator it_left = left.begin();
	VI::iterator it_right = right.begin();

	int carry = 0;
	while ( it_left != left.end() || it_right != right.end() )
	{
		int l = 0, r = 0;
		if ( it_left != left.end() ) l = *it_left;
		if ( it_right != right.end() ) r = *it_right;

		result.push_back( ( l + r + carry ) % 10 );
		carry = ( l + r + carry >= 10 ) ? 1 : 0;

		if ( it_left != left.end() ) it_left ++;
		if ( it_right != right.end() ) it_right ++;
	}
	if ( carry ) result.push_back( 1 );

	reverse( result.begin(), result.end() );
	return result;
}

void print_number( VI& number )
{
	for ( VI::iterator it = number.begin(); it != number.end(); it++ ) cout << *it;
	cout << endl;
}

int main( void )
{
	int n; cin >> n;
	for ( int i = 0; i < n; i++ )
	{
		string input_a, input_b;
		cin >> input_a >> input_b;

		VI a = string_to_vi( input_a );
		VI b = string_to_vi( input_b );
		VI c = add( a, b );

		cout << c.size() << endl;
		if ( c.size() > 80 ) cout << "overflow" << endl;
		else print_number( c );

	}
	return 0;
}