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 <iomanip>
#include <cassert>
#include <string>
#include <cstring>
#include <algorithm>

using namespace std;

typedef long long ll;

const ll BASE = 10000;
const int LogB = 4;
const int MAX_DIGIT = 100;

struct Bigint {
	ll digit[MAX_DIGIT];
	int size;
	Bigint (int sz = 1, ll a = 0) : size(sz) {
		memset(digit, 0, sizeof(digit));
		digit[0] = a;
	}
};

const Bigint ZERO(1,0), ONE(1, 1);

bool operator < (Bigint x, Bigint y) {
	if (x.size != y.size) return x.size < y.size;
	for (int i=x.size-1; i>=0; i--) if (x.digit[i] != y.digit[i]) return x.digit[i] < y.digit[i];
	return false;
}

bool operator > (Bigint x, Bigint y) { return y < x; }
bool operator <= (Bigint x, Bigint y) { return !(y < x); }
bool operator >= (Bigint x, Bigint y) { return !(x < y); }
bool operator != (Bigint x, Bigint y) { return x < y || y < x; }
bool operator == (Bigint x, Bigint y) { return !(x < y) && !(y < x); }

Bigint normal(Bigint x) {
	ll c = 0;
	for (int i=0; i<x.size; i++) {
		while (x.digit[i] < 0)
			x.digit[i+1] -= 1, x.digit[i] += BASE;
		ll a = x.digit[i] + c;
		x.digit[i] = a % BASE;
		c = a / BASE;
	}
	for (; c>0; c /= BASE) x.digit[x.size++] = c % BASE;
	while (x.size > 1 && x.digit[x.size-1] == 0) x.size--;
	return x;
}

Bigint convert(ll a) { return normal(Bigint(1, a)); }

Bigint convert(const string& s) {
	Bigint x;
	int i = s.size() % LogB;
	if (i > 0) i -= LogB;
	for (; i<(int)s.size(); i += LogB) {
		ll a = 0;
		for (int j=0; j<LogB; j++) a = 10 * a + (i+j >= 0 ? s[i+j] - '0' : 0);
		x.digit[x.size++] = a;
	}
	reverse(x.digit, x.digit+x.size);
	return normal(x);
}

ostream &operator << (ostream& os, Bigint x) {
	os << x.digit[x.size-1];
	for (int i=x.size-2; i>=0; i--) os << setw(LogB) << setfill('0') << x.digit[i];
	return os;
}

istream &operator >> (istream& is, Bigint &x) {
	string s; is >> s;
	x = convert(s);
	return is;
}

Bigint operator + (Bigint x, Bigint y) {
	if (x.size < y.size) x.size = y.size;
	for (int i=0; i<y.size; i++) x.digit[i] += y.digit[i];
	return normal(x);
}

Bigint operator - (Bigint x, Bigint y) {
	assert(x >= y);
	for (int i=0; i<y.size; i++) x.digit[i] -= y.digit[i];
	return normal(x);
}

Bigint operator * (Bigint x, Bigint y) {
	Bigint z(x.size + y.size);
	for (int i=0; i< x.size; i++)
		for (int j=0; j<y.size; j++)
			z.digit[i+j] += x.digit[i] * y.digit[j];
	return normal(z);
}

Bigint operator * (Bigint x, ll a) {
	for (int i=0; i<x.size; i++)
		x.digit[i] *= a;
	return normal(x);
}

pair<Bigint, ll> divmod(Bigint x, ll a) {
	ll c = 0, t;
	for (int i=x.size-1; i>=0; i--) {
		t = BASE*c + x.digit[i];
		x.digit[i] = t / a;
		c = t % a;
	}
	return pair<Bigint, ll>(normal(x), c);
}

Bigint operator / (Bigint x, ll a) { return divmod(x, a).first; }

ll operator % (Bigint x, ll a) { return divmod(x, a).second; }

pair<Bigint, Bigint> divmod(Bigint x, Bigint y) {
	if (x.size < y.size) return pair<Bigint, Bigint>(ZERO, x);
	int F =BASE / (y.digit[y.size-1] + 1);
	x = x * F; y = y * F;
	Bigint z(x.size - y.size + 1);
	for (int k = z.size - 1, i = x.size-1; k >= 0; k--, i--) {
		z.digit[k] = (i+1 < x.size ? x.digit[i+1] : 0) * BASE + x.digit[i];
		z.digit[k] /= y.digit[y.size-1];
		Bigint t(k + y.size);
		for (int j=0; j < y.size; j++) t.digit[k+j] = z.digit[k] * y.digit[j];
		t = normal(t);
		while (x < t) {
			z.digit[k] -= 1;
			for (int j = 0;j<y.size; j++) t.digit[k+j] -= y.digit[j];
			t = normal(t);
		}
		x = x-t;
	}
	return pair<Bigint, Bigint>(normal(z), x/F);
}

Bigint operator / (Bigint x, Bigint y) { return divmod(x, y).first; }

Bigint operator % (Bigint x, Bigint y) { return divmod(x, y).second; }

int main() {
	int n;
	cin >> n;
	string s1, s2;
	
	for (int i=0; i<n; i++) {
		cin >> s1;
		cin >> s2;
		Bigint x = convert(s1), y = convert(s2);
		Bigint z = x + y;
		if (z.size > 80) cout << "overflow" << endl;
		else cout << z << endl;
	}
	
	return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include <algorithm>
#include <utility>
using namespace std;
using namespace std;
int main(){
	
	int m;
	char in[2][10000];
	char ans[100000];
	int ie[2];
	int ien[2];
	bool max10;
	int Min;
	bool NMin;
	scanf("%d",&m);
	for(;m--;){
		
		for(int i=0;i<2;i++){
			scanf(" %s",&in[i]);
		}
		for(int i=0;i<2;i++){
			for(ie[i]=0;in[i][ie[i]]!='\0';ie[i]++){
				in[i][ie[i]]=in[i][ie[i]]-'0';
			}
		}
		ie[0]--;
		ie[1]--;
		Min=max(ie[0],ie[1]);
		if((Min>80)||(Min>79)||(int(in[0][0])+int(in[1][0])>9)){
			cout<<"overflow"<<endl;
		}else{	
			if(ie[0]>ie[1]){
				NMin=0;
			}else{
				NMin=1;
			}
			ien[0]=ie[0];
			ien[1]=ie[1];
			for(;min(ien[0],ien[1])+1;ien[0]--,ien[1]--){
				in[NMin][ien[NMin]]=in[0][ien[0]]+in[1][ien[1]];
				if(in[NMin][ien[NMin]+1]>9){
					in[NMin][ien[NMin]+1]-=10;
					in[NMin][ien[NMin]]  +=1;
				}
				
			}
			max10=0;
			if(in[NMin][ien[NMin]+1]>9){
				in[NMin][ien[NMin]+1]-=10;
				max10=1;
			}
			for(int i=0;i<2;i++){
				for(int j=0;j<ie[i]+1;j++){
					in[i][j]=in[i][j]+'0';
				}
			}
			if(max10) cout<<"1";
			cout<<in[NMin]<<endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include <algorithm>
#include<string.h>
#include <utility>
using namespace std;
using namespace std;
int main(){
	
	int m;
	char in[2][100];
	char ans[100];
	int ie[2];
	int ien[2];
	bool max10;
	int Min;
	bool NMin;
	scanf("%d",&m);
	for(;m--;){
		
		for(int i=0;i<2;i++){
			scanf(" %s",&in[i]);
		}
		ie[0]=strlen(in[0])-1;
		ie[1]=strlen(in[1])-1;
		Min=max(ie[0],ie[1]);
		if((Min>79)||((Min>78)&&(ie[0]==ie[1])&&((int(in[0][0])+int(in[1][0]))>9))){
			cout<<"overflow"<<endl;
		}else{	
			if(ie[0]>ie[1]){
				NMin=0;
			}else{
				NMin=1;
			}
			ien[0]=ie[0];
			ien[1]=ie[1];
			for(;min(ien[0],ien[1])+1;ien[0]--,ien[1]--){
				in[NMin][ien[NMin]]=in[0][ien[0]]+in[1][ien[1]]-'0';
				if(in[NMin][ien[NMin]]>9+'0'){
					in[NMin][ien[NMin]]-=10;
					in[NMin][ien[NMin]-1]  +=1;
				}
			}
			max10=0;
			for(;ien[NMin]>-1;ien[NMin]--){
				if(in[NMin][ien[NMin]]>9+'0'){
					in[NMin][ien[NMin]]-=10;
					in[NMin][ien[NMin]-1]+=1;
					max10=1;
				}else{
					max10=0;
				}
			}
			if(max10) cout<<"1";
			cout<<in[NMin]<<endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
void addplace(unsigned int *a, unsigned int *last, long long num){
if( a == last ) return;
int carry = ((long long)*a * 10L + num) / 1000000000L;
addplace(a+1, last, carry);
*a = ((long long)*a * 10L + num) % 1000000000L;
}
int trace(unsigned int *a, unsigned int *last){
if( a == last ) return 0;
if( !trace(a+1, last) ){
if( *a > 0 ){
cout << *a;
return 1;
}
}else{
char b[11]={};
sprintf(b,"%d",*a+1000000000);
cout<<b+1;
return 1;
}
return 0;
}
void add(unsigned int *a, unsigned int *alast, unsigned int *b, int num=0){
if( a == alast ) return;
int carry = (*a + *b + num) / 1000000000L;
add(a+1, alast, b+1, carry);
*a = (*a + *b + num) % 1000000000L;
}
int main(){
int n;
cin>>n;
string a,b;
getline(cin, a);
for(;n--;){
getline(cin, a);
getline(cin, b);
unsigned int _a[9]={},_b[9]={};
for(string::iterator it=a.begin();
it!=a.end(); it++){
addplace(_a, _a+9, *it-'0');
}
for(string::iterator it=b.begin();
it!=b.end(); it++){
addplace(_b, _b+9, *it-'0');
}
add(_a, _a+9, _b);
if( _a[8] >= 100000000 ){
cout<<"overflow\n";
}else{
trace(_a, _a+9);
cout<<'\n';
}
}
}