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 <vector>
#include <algorithm>

using namespace std;

int main (void) {
    int N;
    cin >> N;
    while (N--) {
        string s1, s2;
        cin >> s1;
        cin >> s2;
        vector<int> n1, n2, res;
        for (int i = s1.size(); i--;) {
            n1.push_back((int)(s1[i] - '0'));
        }
        for (int i = s2.size(); i--;) {
            n2.push_back((int)(s2[i] - '0'));
        }
        if (n1.size() < n2.size()) {
            for (int i = n1.size(); i < n2.size(); i++) {
                n1.push_back(0);
            }
        } else if (n2.size() < n1.size()) {
            for (int i = n2.size(); i < n1.size(); i++) {
                n2.push_back(0);
            }
        }
        int s, c = 0;
        for (int i = 0; i < n1.size(); i++) {
            s = n1[i] + n2[i] + c;
            res.push_back(s % 10);
            c = s / 10;
        }
        if (c != 0) {
            res.push_back(c);
        }
        if (res.size() > 80) {
            cout << "overflow" << endl;
        } else {
            int i = res.size();
            while (res[i - 1] == 0) {
                i--;
            }
            while (i--) {
                cout << res[i];
            }
            cout << endl;
        }
    }
    return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <algorithm>
using namespace std;
int main(){
	int N;
	string x, y, temp;
	int i, a[80];

	cin >> N;

	for(i = 0;i < 80;i++){
		a[i] = 0;
	}

	while(N != 0){
		if(N == 0) break;
		cin >> x >> y;

		if(x.size() > 80 || y.size() > 80){
			cout << "overflow" << endl;
		}

		if(x.size() < y.size()){
			temp = x;
			x = y;
			y = temp;
		}
		int xi = 0, yi = 0, sum = 0;
		for(i = 0;i < x.size();i++){
			xi = x[x.size() - 1 - i] - '0';
			//cout << "xi = " << xi << endl;
			if(i >= y.size()){
				yi = 0;
			}
			else {
				yi = y[y.size() - 1 - i] - '0';
				//cout << "yi = " << yi << endl;
			}
			a[i] += xi + yi;
			//cout << "xi + yi  = " << a[x.size() - 1 - i] << endl;
			if(a[i] > 9){
				if(i < 79){
					a[i] = a[i] - 10;
					a[i + 1] += 1;
				}
				else if(i >= 79){
					cout << "overflow"	<< endl;				
				}
			}

			
		}
		bool start = false;
		for(i = 79;i >= 0;i++){
			if(!start && a[i] > 0){
				start = true;
			}
			else if(start){
				cout << a[i];
			}
		}
		cout << endl;
		for(i = 0;i < 80;i++){
				a[i] = 0;
		}
		N--;
	}
	return 0;
}

C++: #include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

int c[100];

void add(char*a, char*b)  //鮟倩ョ、a豈巴髟ソ
{
    fill(c,c+100,0);      //蜥檎噪蜷?ス咲スョ髮カ
    int la=strlen(a), lb=strlen(b);
        for(int i=la,j=lb;i>la-lb&&j>0;i--,j--) // 菫晉蕗c豈泌刈謨ー譛?柄荳イ螟壻ク?ス?        {
            c[i]+=a[i-1]-'0'+b[j-1]-'0';
            if(c[i]>9)
            {
                c[i]-=10;
                c[i-1]++;
            }
        }
        for(int i=la-lb;i>0;i--)
        {
            c[i]+=a[i-1]-'0';
            if(c[i]>9)
            {
                c[i]-=10;
                c[i-1]++;
            }
        }
        if(la==80&&c[0]==1) printf("overflow\n");
        else
        {
            if(c[0]==0)
            {
                for(int i=1;i<=la;i++)
                    printf("%d",c[i]);
                printf("\n");
            }
            else
            {
                for(int i=0;i<=la;i++)
                   printf("%d",c[i]);
                printf("\n");
            }
        }
}

int main()
{
    char a[100], b[100];
    int n;
    scanf("%d",&n);

    while(n--){
    scanf("%s%s",a,b);
    int la = strlen(a), lb = strlen(b);
    if(la>80 || lb>80)
        printf("overflow\n");
    else if(la>lb)
        add(a,b);
    else add(b,a);
    }
    return 0;
}

C++: #include <iostream>
#include <string>
#include <sstream>
using namespace std;
string toStr(int n) {
    ostringstream os; os << n;
    return os.str();
}
string add(string a, string b) {
    while (a.size() > b.size()) b = "0" + b;
    while (b.size() > a.size()) a = "0" + a;
    string res = "";
    int carry = 0;
    for (int i=a.size()-1; i>=0; --i) {
        int t = (a[i] - '0') + (b[i] - '0') + carry;
        res = toStr(t % 10) + res;
        carry = t / 10;
    }
    if (carry) res = "1" + res;

    return (res.size() <= 80) ? res : "overflow";
}
int main() {
    int n; cin >> n;
    string a, b;
    while (n--) {
        cin >> a >> b;
        cout << add(a, b) << endl;
    }
    return 0;
}

C++: #include <stdio.h>

#define N 80

// Longint <- String
void init(int a[], char s[]);
// a <- b + c
int add(int a[], int b[], int c[]);
// print Longint
void print(int a[]);

int main(void){
	int n;
	int a[N], b[N], sum[N];
	char s[101];
	
	for (int i=0; i<n; i++){
		scanf("%s", s);
		init(a, s);
		scanf("%s", s);
		init(b, s);
		if (add(sum, a, b)==-1){
			puts("overflow");
		} else {
			print(sum);
		}
	}
	return 0;
}

// Longint <- String
void init(int a[], char s[]){
	int len=0;
	
	for (int i=0; i<N; i++) a[i] = 0;
	for (char *p=s; *p!='\0'; p++) len++;
	for (int i=0; s[i]!='\0'; i++){
		a[N-len+i] = s[i] - '0';
	}
}
// a <- b + c
int add(int a[], int b[], int c[]){
	int cry=0;
	for (int i=N-1; i>=0; i--){
		a[i] = b[i]+c[i]+cry;
		cry = a[i]/10;
		a[i] %= 10;
	}
	return cry ? -1 : 0;
}

// print Longint
void print(int a[]){
	int i;
	for (i=0; i<N && a[i]==0; i++)
	;
	if (i==N){
		puts("0");
		return;
	} else {
		for (; i<N; i++){
			printf("%d", a[i]);
		}
		puts("");
	}
}

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

using namespace std;

int main() {
	int N; cin >> N;
	for (int i=0; i<N; i++) {
		string a, b;
		cin >> a >> b;
		int sum, ret=0;
		if (a.length() > b.length()) {
			int l = b.length()-1;
			for (int i=a.length()-1; i>=0; i--) {
				if (l >= 0) {
					sum = (a[i]-48)+(b[l]-48)+ret;
					l--;
				} else {
					sum = (a[i]-48)+ret;
				}
				if (sum>=10) {
					ret = sum/10;
					sum -= ret*10;
				} else {
					ret = 0;
				}
				a[i] = sum+48;
			}
			if (ret != 0) {
				a.insert(a.begin(), ret+48);
			}
			if (a.length() > 80) cout << "overflow" << endl;
			else cout << a << endl;
		} else {
			int l = a.length()-1;
			for (int i=b.length()-1; i>=0; i--) {
				if (l >= 0) {
					sum = (a[i]-48)+(b[i]-48)+ret;
					l--;
				} else {
					sum = (a[i]-48)+ret;
				}
				if (sum>=10) {
					ret = sum/10;
					sum -= ret*10;
				} else {
					ret = 0;
				}
				b[i] = sum+48;
			}
			if (ret != 0) {
				b.insert(b.begin(), ret+48);
			}
			if (b.length() > 80) cout << "overflow" << endl;
			else cout << b << endl;
		}
	}
	return 0;
}