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 <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define all(a) a.begin(),a.end()
using namespace std;

int main(){
	int n;
	cin>>n;
	rep(i,0,n){
		string s1,s2;
		cin>>s1>>s2;

		if(s1.size()<s2.size()) swap(s1,s2);

		for(int j=s1.size()-1,k=s2.size()-1;j>=0;j--,k--){
			if(k>=0) s1[j]+=s2[k]-'0';
			if(s1[j]>'9'){
				s1[j]-=10;
				if(j==0) s1="1"+s1;
				else s1[j-1]++;
			}
		}
		if(s1.size()>80){
			cout<<"overflow"<<endl; continue;
		}
		cout<<s1<<endl;
	}
}

/*int main(){
    int n;
    cin>>n;
    rep(i,0,n){
        int ans[85]={};
        vector<int> n1(80,0),n2(80,0);
        //rep(j,0,81)cout<<n1[j]<<" "<<n2[j]<<endl;
        string s1,s2; 
        cin>>s1>>s2;
        //cout<<s1<<" "<<s2<<endl;
        int sz1=s1.size(),sz2=s2.size();
 
        //rep(j,0,sz1) n1[j]=s1[sz1-1-j]-'0';
        //rep(j,0,sz2) n2[j]=s2[sz2-1-j]-'0';
 		
 		reverse(all(s1));
 		reverse(all(s2));

        rep(j,0,min((int)s1.size(),79)) n1[j]=s1[j]-'0';
        rep(j,0,min((int)s2.size(),79)) n2[j]=s2[j]-'0';

        reverse(all(n1));
        reverse(all(n2));

        for(int j=79;j>=0;j--){
           // cout<<"  "<<j<<" "<<n1[j]<<" "<<n2[j]<<endl;
            ans[j]+=n1[j]+n2[j];
            if(ans[j]>9){
            	if(j>0) {
            		ans[j-1]=1;
            		ans[j]-=10;
            	}
            }
            //cout<<" "<<j<<" "<<ans[j]<<endl;
        }
        if(ans[0]>9){
            cout<<"overflow"<<endl; break;
        }
        bool f=0;
        for(int j=0;j<80;j++){
            if(f==0 && ans[j]>0){
                f=1; cout<<ans[j];
            }else if(f||j==79) cout<<ans[j];
        }
        cout<<endl;
    }
}*/

C++: #include<iostream>
#include<string>
#include<sstream>
#include<iomanip>
using namespace std;
class BigInt{
  unsigned int i[11];
public:
  BigInt(string str){
    if(str.size()>80){i[0]=1; return;}
    i[0]=0;
    for(int j=80;j>0;j-=8){
      if((int)str.size()>j){
	stringstream ss;
	ss << str.substr(str.size()-j,8);
	ss >> i[11-j/8];
      }else if((int)str.size()+8>j){
	stringstream ss;
	ss << str.substr(0,str.size()+8-j);
	ss >> i[11-j/8];
      }else{
	i[11-j/8]=0;
      }
    }
  }
  BigInt():i{0,0,0,0,0,0,0,0,0,0,0}
  {}
  void print(){
    if(i[0]>0)
      cout << "overflow\n";
    else{
      int j=1;
      for(;j<11;j++)
	if(i[j]>0 || j == 10)
	  break;
      cout << i[j++];
      for(;j<11;j++)
	cout << setfill('0') << setw(8) << right << i[j];
      cout << "\n";
    }
  }
  BigInt operator+(const BigInt& rhs){
    BigInt result = rhs;
    for(int j=10;j>0;j--){
      result.i[j] += i[j];
      if(result.i[j]>=100000000){
	result.i[j]-=100000000;
	result.i[j-1]++;
      }
    }
    result.i[0]+=i[0];
    return result;
  }
};

int main(){
  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    string tmp;
    cin>>tmp;
    BigInt b(tmp);
    cin>>tmp;
    BigInt a(tmp);
    (a+b).print();
  }
}

C++: #include <iostream>
#include <string>
#include <stack>
#include <algorithm>
using namespace std;

int main(){
	string s1, s2;
	stack<int> sum;
	int tmp, carry, n, len1, len2;

	cin>>n;
	while(n--){
		tmp = carry = 0;
		while(!sum.empty())sum.pop();
		cin>>s1>>s2;
		len1 = s1.length()-1;
		len2 = s2.length()-1;
		reverse(s1.begin(), s1.end());
		reverse(s2.begin(), s2.end());

		for(int i=0; i<81; i++){
			tmp = carry;
			if(i<=len1) tmp += s1[i]-'0';
			if(i<=len2) tmp += s2[i]-'0';
			sum.push(tmp%10);
			carry = tmp/10;
		}
		if(sum.top() != 0)cout<<"overflow\n";
		else{
			for(int i=0; i<80; i++){
				if(sum.top()==0)sum.pop();
				else break;
			}
			while(!sum.empty()){cout<<sum.top(); sum.pop();}
			cout<<"\n";
		}
	}	
	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <cstring>
#include <functional>

using namespace std;

#define REP(i,a,b) for((i)=(a);(i)<(int)(b);(i)++)
#define rep(i,n) REP(i,0,n)
// BEGIN CUT HERE
#define foreach(c,itr) for(typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
// END CUT HERE

int main(){
  int i, j, n;

  cin >> n;
  rep(i,n){
    string str1, str2, res;
    cin >> str1;
    cin >> str2;

    vector<int> a(82, 0);
    rep(j,str1.length()) a[j] = str1[str1.length()-1-j] - '0';

    vector<int> b(82, 0);
    rep(j,str2.length()) b[j] = str2[str2.length()-1-j] - '0';

    rep(j,81){
      int sum = a[j] + b[j];
      if(sum >= 10){ sum %= 10; a[j+1]++;}
      res += (sum + '0');
    }

    reverse(res.begin(), res.end());
    bool f = false;
    rep(j,res.length()){
      if(res[j] != '0') f = true;
      if(f) cout << res[j];
    }
    cout << endl;
  }

  return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
 
#define rep(i, n) for(int i = 0; i < n; i ++)
#define ALL(T) T.begin(), T.end()
#define mp make_pair
#define pb push_back
#define MEMSET(v, h) memset((v), h, sizeof(v))
 
using namespace std; 

typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;

const int INF = 1 << 24;
 
int main(void){
    int n; cin >> n;

    while(n --){
        vi res(81);
        rep(i, 2){
            string in; cin >> in;
            rep(j, in.size() + 1){
                if(j != in.size()) res[j] += in[in.size() - j - 1] - '0';
                for(int l = 0; res[j + l] > 9; l ++) res[j + l + 1] ++, res[j + l] %= 10;
            }
        }

        if(res[80]){ cout << "overflow" << endl; continue; }

        bool ok = false;
        for(int i = 79; i >= 0; i --){
            if(!ok) if(res[i]) ok = true;
            if(ok) cout << res[i];
        }
        cout << endl;
    }
 
    return 0;
}

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

using namespace std;

int main(){
    int n; cin >> n;
    while(n--){
        string a,b;
        cin >> a >> b;
        reverse(a.begin(), a.end());
        reverse(b.begin(), b.end());
        if(b.size() < a.size()) swap(a,b);
        b += "0";
        for(int i=0; i<b.size()-1; i++){
            int aa = i < a.size() ? a[i] - '0' : 0;
            int bb = b[i] - '0';
            int cc = aa + bb;
            b[i] = (cc%10) + '0';
            //cout << aa << "+" << bb << "=" << cc << endl;
            if(cc >= 10){
                b[i+1]++;
            }
        }
        if(b[b.size()-1] == '0')
            b = string(b.begin(), b.end()-1);
        reverse(b.begin(), b.end());
        cout << b << endl;
    }
    return 0;
}