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 >> 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 <cstdio>
using namespace std;

int main(){
	int N;
	char str1[90], str2[90];
	int num1[80], num2[80], sum[80];
	int pos, pos2, up;
	
	scanf("%d", &N);
	for(int n = 0; n < N; n++){
		for(int i = 0; i < 90; i++){
			str1[i] = 0;
			str2[i] = 0;
		}
		for(int i = 0; i < 80; i++){
			num1[i] = 0;
			num2[i] = 0;
			sum[i] = 0;
		}
		scanf("%s", str1);
		scanf("%s", str2);
		
		pos = 89;
		while(str1[pos] == 0 && pos >= 0) pos--;
		pos2 = 0;
		while(str1[pos] != 0 && pos >= 0){
			num1[pos2++] = str1[pos--] - 48;
		}
		pos = 89;
		while(str2[pos] == 0 && pos >= 0) pos--;
		pos2 = 0;
		while(str2[pos] != 0 && pos >= 0){
			num2[pos2++] = str2[pos--] - 48;
		}
		
		up = 0;
		for(int i = 0; i < 80; i++){
			sum[i] = num1[i] + num2[i] + up;
			up = sum[i] / 10;
			sum[i] = sum[i] % 10;
		}
		
		if(up > 0 || sum[79] > 0) printf("overflow\n");
		else{
			pos = 79;
			while(sum[pos] == 0) pos--;
			while(pos >= 0){
				printf("%d", sum[pos--]);
			}
			printf("\n");
		}
	}
	
	return 0;
}

C++: #include <stdio.h>
int main(){
    int n,now,k,top=0;
    char a[1000],temp[1000];
    scanf("%d",&n);
    for(int i=0;i<n;i++){
    for(int j=0;j<1000;j++)a[j]=temp[j]='\0';
    for(int m=0;m<2;m++){
       scanf("%s",temp);
        top=k=now=0;
        while(temp[now]!='\0')now++;
        for(int j=now-1;j>=0;j--){
            if(a[now-j-1]=='\0')a[now-j-1]+='0';
            a[now-j-1]+=temp[j]+k-'0';
            k=0;
            if(a[now-j-1]-'0'>9){
                a[now-j-1]-=10;
                k++;
            }
        }
        while(k!=0){
            if(a[now]=='\0')a[now]+='0';
            a[now]+=k;
            k=0;
            if(a[now]-'0'>9){
                a[now]-=10;
                k++;
            }
            now++;
        }
        }
        while(a[top]!='\0')top++;
        if(top>80)printf("overflow\n");
        else{
            for(int i=top-1;i>=0;i--)printf("%c",a[i]);
            printf("\n");
        }
    }
    }

C++: #include <iterator>
#include <typeinfo>
#include <list>
#include <map>     
#include <numeric>
#include <utility>
#include <queue>
#include <set>
#include <sstream>
#include <iomanip>
#include <iostream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define ld long double
#define rep(a,t) for(int a=0;a<t;++a) 
#define forever while(true)
#define Sort(a) sort(a.begin(),a.end())
#define Reverse(a) reverse(a.begin(),a.end())
#define pb push_back
#define int_maxvalue numeric_limits<int>::max()
ll mod = 1e9 + 7;
string Addition(string a,string b) {
	string ans = "";
	int bef = 0;
	int be1 = 0;
	for (int i = a.length() - 1; i >= 0; i--) {
		int added = stoi(a.substr(i, 1)) + stoi(b.substr(i, 1))+be1;

		if (added >= 10) {
			bef = 1;
			added -= 10;
		}
		else {
			bef = 0;
		}

		ans = to_string(added)+ans;
		/*/
		stringstream ss;
		ss << added;

		ans = ss.str() + ans;*/
		be1 = bef;
		if (i == 0)
		{
			break;
		}
	}
	if (be1 == 1) {
		ans = "1" + ans;
	}
	return ans;
}
int main() {
	int n;
	cin >> n;
	rep(o1, n) {
		string a, b;
		cin >> a >> b;
		if (a.length() < b.length()) {
			swap(a, b);
		}
		string b1 = b;
		for (int i = 0; i < a.length() - b1.length(); ++i) {
			b = '0' + b;
		}
		string ans = Addition(a, b);
		if (ans.length() > 80) { cout << "overflow" << endl; }
		else {
			cout << ans << endl;
		}
	}
	return 0;
}