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 <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>

const int MAX_INPUT = 1000000;
const int ARRAY_SIZE = 20;
const int MAX_LEN = 8;
char inputA[MAX_INPUT];
char inputB[MAX_INPUT];

void toBigInt(char *str, long *r) {
    int len = strlen(str);
    int endIndex = ARRAY_SIZE - (len / MAX_LEN) - 1;

    {
        int offset = 0;
        for (int i = 0; i < ARRAY_SIZE; ++i) {
            char temp[MAX_LEN + 1] = { 0 };
            int readLen = ((len - offset) < MAX_LEN) ? len - offset : MAX_LEN;
            char* start = str + len - offset - readLen;

            strncpy(temp, start, readLen);
            r[ARRAY_SIZE - i- 1] = (long)atoi(temp);
            offset += readLen;
        }
    }
}

int main() {
    const char OVER[] = "overflow\n";
    int n = 0;
    scanf("%d", &n);

    for (int i = 0; i < n; ++i) {
        scanf("%s", &inputA);
        scanf("%s", &inputB);
        long a[ARRAY_SIZE] = { 0 };
        long b[ARRAY_SIZE] = { 0 };
        long r[12] = { 0 };
        int lenA = 0;
        int lenB = 0;
        const int MAX_INPUT_LEN = 80;
        lenA = strlen(&inputA[0]);
        lenB = strlen(&inputB[0]);
        if ((MAX_INPUT_LEN < lenA) || (MAX_INPUT_LEN < lenB)) {
            printf(OVER);
            continue;
        }

        toBigInt(inputA, a);
        toBigInt(inputB, b);
        for (int i = 0; i < ARRAY_SIZE; ++i) {
            int curRIndex = 12 - i - 1;
            r[curRIndex] += a[ARRAY_SIZE - i - 1] + b[ARRAY_SIZE - i - 1];
            const int MAX = 99999999;
            if (MAX < r[curRIndex]) {
                r[curRIndex - 1] = r[curRIndex] / (MAX + 1);
                r[curRIndex] %= (MAX + 1);
            }
        }

        if ((9999999 < r[2]) || (0 < r[1]) || (0 < r[0])) {
            printf(OVER);
            continue;
        }

        {
            bool started = false;
            bool noOutput = true;
            for (int i = 0; i < 12; ++i) {
                if (!started && (0 < r[i])) {
                    started = true;
                    printf("%d", r[i]);
                    noOutput = false;
                    continue;
                }

                if (started) {
                    long temp = (r[i] == 0) ? 1 : r[i];
                    bool didFor = false;
                    for (int j = 0; temp * pow(10, j) < 1000000; ++j) {
                        printf("0");
                        didFor = true;
                    }
                    if (didFor) {
                        printf("0");
                    }
                    printf("%d", r[i]);
                }
            }

            if (noOutput) {
                printf("0");
            }
        }
        printf("\n");
        for (int i = 0; i < MAX_INPUT; ++i) {
            inputA[i] = 0;
            inputB[i] = 0;
        }
    }
    return 0;
}

C++: #include <iostream>
#include <string>
#include <typeinfo>
#include <sstream>
using namespace std;
int main()
{
    int n;
	cin>>n;
	string a,b;
	while(n--){
		int s,keta=0;
		cin>>a>>b;
		int ai[85]={},bi[85]={},sum[85]={};
		int as,bs;
		char c;
		as=a.size();
		bs=b.size();
		if(as>80||bs>80){
			cout<<"overflow"<<endl;
		}else{
			for(int i=0;i<as;i++){c=a[as-i-1];ai[i]=c-'0';}
			for(int i=0;i<bs;i++){c=b[bs-i-1];bi[i]=c-'0';}
			for(int i=0;i<=max(as,bs);i++){
				s=ai[i]+bi[i]+sum[i];
				if(s)keta=i;
				if(s>9){
					sum[i]=s%10;
					sum[i+1]++;
				}else{
					sum[i]=s;
				}
			}
			if(sum[80]){
				cout<<"overflow"<<endl;
			}else{
				for(int i=keta;i>=0;i--){
					cout<<sum[i];
				}
				cout<<endl;
			}

		}
	}
    return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
#include <list>
using namespace std;
 
int main()
{
    int n;
    cin>> n;
    string str1,str2;
    vector<string>s1;
    vector<string>s2;
    bool bo=false;
    for(int i=0;i<n;i++){
       cin>>str1;
       s1.push_back(str1);  
       cin>>str2;    
       s2.push_back(str2);
       if(str1.size()>80 ||str2.size()>80) bo=true;
    }
    if(bo){cout<<"overflow"<<endl;}
    else{
       for(int i=0;i<n;i++){
           string str3=s1[i];
           string str4=s2[i];
           int k=str3.size();
           int l=str4.size();
           int max=k>l?k:l;
           int a[80]={0};
           int b[80]={0};
           for(int j=0;j<k;j++){
                a[j]=str3[j]-'0'; } 
           for(int j=0;j<l;j++){
                b[j]=str4[j]-'0'; }
           int temp=0;
           char s[80];
           for(int i=0;i<max;i++){
               int d;
               if(l>i&&k>i) d=a[k-1-i]+ b[l-1-i]+temp;
               if(l<=i&&k>i) d=a[k-1-i]+temp;
               if(l>i&&k<=i) d=b[l-1-i]+temp;
               s[max-1-i]=(d%10)+'0';
               if(d>=10) temp=1;
               else temp=0;
           }
           if(strlen(s)+temp>80) cout<<"overflow"<<endl;
           else{ 
                 if(temp==1) cout<<"1";
                 for(int i=0;i<max;i++){
                    cout<<s[i];}
                }
          cout<<endl;
        } 
    }   
    return 0; 
}

C++: //RE
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<string>
#include<sstream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cctype>
#include<climits>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; i++)
#define FOR(i, j, k) for(int i = j; i < k; i++)
#define P pair<int, int>
const int INF = INT_MAX / 2;
const int N = 100;

vector<int> makeDx(string str){
    reverse(str.begin(), str.end());
    vector<int> ret(N, 0);
    REP(i, str.size()) ret[i] = str[i] - '0';
    return ret;
}

bool isOver80(vector<int> dx){
    FOR(i, 80, dx.size()) if(dx[i] != 0) return true;
    return false;
}

int main(){
    int n; cin >>n;
    REP(z, n){
        string str[2]; cin >>str[0] >>str[1];
        vector<int> dx[2] = {makeDx(str[0]), makeDx(str[1])};
        vector<int> ans(N, 0);

        if(isOver80(dx[0]) || isOver80(dx[1])){
            cout <<"NA" <<endl;
            continue;
        }

        REP(i, max(dx[0].size(), dx[1].size())){
            ans[i] += (dx[0][i] + dx[1][i]);
            ans[i + 1] += (ans[i] / 10);
            ans[i] = ans[i] % 10;
        }

        if(isOver80(ans)){
            cout <<"NA" <<endl;
            continue;
        }

        reverse(ans.begin(), ans.end());
        int s = 0;
        while(ans[s] == 0 && s < N - 1) s++;
        FOR(i, s, N) cout <<ans[i];
        cout <<endl;
    }
    return 0;
}