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<string>
#include<vector>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<sstream>
#include<functional>
#include<map>
#include<stack>
#include<set>
#include<cmath>

#define REP(i,s,e) for(int i=int(s);i<int(e);i++)
#define rep(i,n) for(int i=0;i<int(n);i++)

#define EPS 1e-6

using namespace std;

int main(){

	int n;
	cin >> n;

	rep(i,n){

	string a,b;
	cin >> a >> b;

	int sa=a.size(); int sb=b.size(); int p=max(sa,sb);
	vector<char>s;

	if(sa>80 || sb>80)
	cout << "overflow" << endl;
	else{

	string z;
	if(sa>sb){
	rep(j,sa-sb)
	z+='0';
	b=z+b;
	}
	if(sb>sa){
	rep(j,sb-sa)
	z+='0';
	a=z+a;
	}

    int c=0;
	rep(j,p){

	c+=(a[p-1-j]-'0')+(b[p-1-j]-'0');

	s.push_back(c%10+'0');
	c=c/10;

	}

    if(c==1) s.push_back(c%10+'0');

    if(s.size()>80)
    cout << "overflow" << endl;
    else
    rep(k,s.size()) cout << s[s.size()-1-k];

    s.clear();
    cout << endl;

	}
	}

	return 0;
}

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

using namespace std;

void reverse(string *s){
	for(int i=0;i<s->length()/2;i++){
		char tmp=s->at(i);
		s->at(i)=s->at(s->length()-i-1);
		s->at(s->length()-i-1)=tmp;
	}
}

int main(void){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		string s1,s2;
		cin>>s1;
		cin>>s2;
		if(s1.length()>80||s2.length()>80){
			cout<<"overflow"<<endl;
		}else{
			string s3;
			string tmp;
			if(s1.length()<s2.length()){
				tmp=s1;
				s1=s2;
				s2=tmp;
			}
			int c=0;
			for(int j=0;j<s1.length();j++){
				int tmp;
				if(j<s2.length()){
					tmp=s1[s1.length()-j-1]-'0'+s2[s2.length()-j-1]-'0'+c;
				}else{
					tmp=s1[s1.length()-j-1]-'0'+c;
				}
				c=tmp/10;
				s3.append(1,tmp%10+'0');
			}
			if(c!=0){
				s3.append(1,'1');
			}
			reverse(&s3);
			cout<<s3<<endl;
		}
	}
}

C++: #include <cstdio>
#include <cstring>
char A[81],B[81],C[84];
int main() {
	int N,Alen,Blen;
	scanf("%d",&N);
	for(int i=0;i<N;i++) {
		scanf("%s",A);
		scanf("%s",B);
		Alen=strlen(A);
		Blen=strlen(B);
		memset(C,-1,sizeof(C));
		for(int j=Alen-1,k=0;j>=0;j--,k++) {
			C[k]=A[j]-'0';
		}
		for(int j=Blen-1,k=0;j>=0;j--,k++) {
			C[k]+=B[j]-'0';
		}
		for(int j=0;C[j]!=-1;j++) {
			if(C[j]/10) {
				if(C[j+1]!=-1)C[j+1]+=C[j]/10;
				else C[j+1]=C[j]/10;
			}
			C[j]%=10;
		}
		for(int j=82;j>=0;j--) {
			if(C[j]!=-1) {
				if(j>80) {
					printf("overflow\n");
					return 0;
				}
				putchar('0'+C[j]);
			}
		}
		putchar('\n');
	}
}

C++: #include <bits/stdc++.h>
using namespace std;

int main() {
    int num; cin >> num;
    for(int k = 0; k < num; k++) {
        string s1, s2, ret;
        vector<int> v1, v2;
        cin >> s1 >> s2;
        if(s2.length() > s1.length()) swap(s1,s2);

        for(int i=0; i<s1.length(); i++) v1.push_back((int)s1[i] - 48);
        for(int i=0; i<s2.length(); i++) v2.push_back((int)s2[i] - 48);
        reverse(v1.begin(), v1.end());
        reverse(v2.begin(), v2.end());

        int n = 0;
        for(int i=0; i<v2.size(); i++) {
            ret += to_string((v1[i] + v2[i] + n) % 10);
            if(v1[i] + v2[i] + n >= 10) n = 1;
            else n = 0;
        }
        for(int i=v2.size(); i<v1.size(); i++) {
            ret += to_string((v1[i] + n) % 10);
            if(v1[i] + n >= 10) n = 1;
            else n = 0;
        }
        if(v1[v1.size() - 1] + n == 10) ret += "1";

        reverse(ret.begin(), ret.end());
        if(ret.length() > 80) cout << "overflow" << endl;
        else cout << ret << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;++i){
		string a,b,c;
		int d=0,st;
		cin>>a>>b;
		for(int j=a.size();j<80;++j) a="0"+a;
		for(int j=b.size();j<80;++j) b="0"+b;
		reverse(a.begin(), a.end());
		reverse(b.begin(), b.end());
		for(int j=0;j<79;++j){
			c+=((a[j]-'0')+(b[j]-'0')+d)%10+'0';
			d=((a[j]-'0')+(b[j]-'0')+d)/10;
		}
		if(d) cout<<"overflow\n";
		else{
			reverse(c.begin(), c.end());
			for(st=0;;++st)if(c[st]!='0')break;
			cout<<c.substr(st,c.size()-st)<<"\n";
		}
	}
	return 0;
}

C++: #include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <string>
#include <cmath>
#include <complex>
#include <map>
using namespace std;

#define rep(i,n) for(int i=0;i<int(n);++i)
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-8
#define F first
#define S second

static const double PI=6*asin(0.5);
typedef pair<double,double> P;
typedef complex<double> CP;
typedef long long ll;


int a[1000],b[1000],c[1000];

int main(){
	int n;
	cin>>n;
	rep(i,n){
		memset(a,0,sizeof(a));
		memset(b,0,sizeof(b));
		memset(c,0,sizeof(c));
		string s,s2;
		cin>>s;
		//cout<<s<<endl;
		//cout<<s.size()<<endl;
		if(s.size()>80){
			cout<<"overflow"<<endl;
			cin>>s2;
			continue;
		}
		rep(j,s.size()){
			a[90-j]=s[s.size()-j-1]-'0';
			//cout<<s[s.size()-j-1]-'0';
		}
		//cout<<a[87]<<endl;
		cin>>s2;
		if(s2.size()>80){
			cout<<"overflow"<<endl;
			continue;
		}
		rep(j,s2.size()){
			b[90-j]=s2[s2.size()-j-1]-'0';
		}
		/*
		rep(j,91) cout<<a[j];
		cout<<endl;
		rep(j,91) cout<<b[j];
		cout<<endl;
		*/
		int t=0;
		for(int j=90;j>=0;j--){
			c[j]=(a[j]+b[j]+t)%10;
			if((a[j]+b[j]+t)>9) t=1;
			else t=0;
		}
		bool f=true;
		/*
		rep(j,91) cout<<c[j];
		cout<<endl;
		*/
		rep(j,91){
			if(f&&c[j]!=0){
				f=false;
				if(j<=10){
					cout<<"overflow";
					break;
				}
			}
			if(!f) cout<<c[j];
		}
		if(f) cout<<"0";
		cout<<endl;
		
	}
	return 0;
}

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

int main(void){
  int N;
  scanf("%d", &N);

  int i,j,k;
  for(i=0; i<N; ++i){
    int digits[3][81];
    for(j=0; j<3; ++j){
      for(k=0; k<81; ++k){
        digits[j][k] = 0;
      }
    }

    for(j=0; j<2; ++j){
      char digit[80];
      scanf("%s", digit);
      for(k=0; k<strlen(digit); ++k){
        digits[j][k] = digit[strlen(digit)-1-k]-'0';
      }
    }
    
    for(j=0; j<80; ++j){
      digits[2][j] += (digits[0][j]+digits[1][j]);
      digits[2][j+1] += digits[2][j]/10;
      digits[2][j] %= 10;
    }

    int flag = 0;
    for(j=80; j>=0; --j){
      if(flag || digits[2][j]!=0){
        flag = 1;
        printf("%d", digits[2][j]);
      }
    }
    printf("\n");
  }
  
  return 0;
}