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<bits/stdc++.h>
using namespace std;
 
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
 
typedef long long ll;
typedef pair<int, int> ii;
 
int main(){

	int n;
	cin >> n;
	while(n--){
		string s1, s2;
		cin >> s1 >> s2;
		
		int carry = 0;
		
		//int mini = min(s1.size(), s2.size());
		int maxi = max(s1.size(), s2.size());
		string ans = "";
		
		REP(i, 0, maxi){
			int sum = carry;
			if(i < s1.size()) sum += (int)(s1[s1.size() - 1 - i] - '0');
			if(i < s2.size()) sum += (int)(s2[s2.size() - 1 - i] - '0');
			ans += ('0' + sum % 10);
			carry = sum / 10;
		}
		if(carry != 0) ans += ('0' + carry);
		reverse(ans.begin(), ans.end());
		if(ans.size() <= 80) cout << ans << endl;
		else cout << "overflow" << endl;
	}
	
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stack>
#include <set>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
#define ALL(v) v.begin(), v.end()

string getsumstr(string a, string b) {
    int carry = 0;
    string sum = "";
    int alen = a.length();
    int blen = b.length();
    while(alen && blen) {
        int an = a[alen-1] - '0';
        int bn = b[blen-1] - '0';
        if (an + bn + carry < 10) {
            sum += to_string(an + bn + carry);
            carry = 0;
        }else {
            sum += to_string(an + bn + carry - 10);
            carry = 1;
        }
        alen--;
        blen--;
    }
    if (alen > 0) {
        while(alen) {
            int an = a[alen-1] - '0';
            if(an + carry < 10) {
                sum += to_string(an + carry);
                carry = 0;
            }else {
                sum += to_string(an + carry - 10);
                carry = 1;
            }
            alen--;
        }
    }else {
        while(blen) {
            int bn = b[blen-1] - '0';
            if(bn + carry < 10) {
                sum += to_string(bn + carry);
                carry = 0;
            }else {
                sum += to_string(bn + carry - 10);
                carry = 1;
            }
            blen--;
        }
    }
    if (carry) sum += "1";
    reverse(sum.begin(), sum.end());
    return sum;
}

int main() {
    string a, b;
    int n;
    cin >> n;
    REP(i,n) {
        cin >> a >> b;
        if (a.size() > 80 || b.size() > 80) cout << "overflow" << endl;
        else {
            string sum = getsumstr(a,b);
            if (sum.size() > 80) cout << "overflow" << endl;
            else cout << sum << endl;
        }
    }
    return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;

int main(void)
{
	char a[1000]={0},b[1000]={0};
	int n,flag,count1,count2,count3,daisyo=0,miss=0;
	cin>>n;

	for (int i=0; i<n; i++) 
	{
		flag=0;
		daisyo=0;
		miss=0;

		cin>>a>>b;
		count1= strlen(a);
		count2= strlen(b);
		
		if (count1>80||count2>80) {
			flag=1;
		}
		count3=count1-count2;
		
		if(count2>count1)
		{
			count3*=-1;
			daisyo=1;
		}
		
		if(daisyo==0)
		{
			if(!(count1==count2))
			for(int j=0;j<=count2;j++)
			{
				b[count2-j+count3]=b[count2-j];
			}
			for (int j=0; j<count3; j++) {
				b[j]='0';
			}
			
			for (int j=1; j<=count1; j++) {
				a[count1-j]+=b[count1-j]-48;
				if (((int)a[count1-j])-48>9) 
				{
					if (j>=80) {
						flag=1;
						break;
					}
					a[count1-j]=(a[count1-j]-48)%10+48;
					if ((count1-j)==0) {
						miss=1;
					}
					else {
							a[count1-j-1]=a[count1-j-1]+1;

						
					}
				}
			}
		}
		
		else
		{
			for(int j=0;j<=count1;j++)
			{
				a[count1-j+count3]=a[count1-j];
			}
			for (int j=0; j<count3; j++) {
				a[j]='0';
			}
			
			for (int j=1; j<=count2; j++) {
				b[count2-j]+=a[count2-j]-48;
				if (((int)b[count2-j]-48)>9) 
				{
					if (j>=80) {
						flag=1;
						break;
					}
					b[count2-j]=(b[count2-j]-48)%10+48;
					if ((count2-j)==0) {
						miss=1;
					}
					else {
						b[count2-j-1]=b[count2-j-1]+1;
					}
				}
			}
		}
		
		if(flag==1)
		{
			cout << "overflow" << endl;
		}
		
		else 
		{
			if (miss==1) {
				cout << '1';
			}
			if(daisyo==0) 
			{
				for (int j=0; j<count1; j++) 
				{
					cout << (int)a[j]-48;
				}
			}
			
			else 
			{
				for (int j=0; j<count2; j++) 
				{
					cout << (int)b[j]-48;
				}
			}
			cout << endl;

		}
		
		
	}
		
		
	
	return (0);
}

C++: #include <iostream>
#include <string>
#include <math.h>
#include <algorithm>
using namespace std;

int main()
{
	int n;
	cin >> n;
	
	for(int j = 0; j < n; ++j)
	{
		string numA;
		string numB;
		cin >> numA >> numB;
		/*
		if(numA.size()<numB.size())swap(numA,numB);
		while(numA.size()>numB.size())numB="0"+numB;
		*/
		while(numA.size() != numB.size())
		{
			if(numA.size() < numB.size())
			{
				numA = "0" + numA;
			}
			else
			{
				numB = "0" + numB;
			}
		}
		
		numA = "0" + numA;
		numB = "0" + numB;
		
		for(int i = numA.size() - 1; i >= 0; --i)
		{
			int sum = 0;
			sum = (numA[i] - '0') + (numB[i] - '0');
			
			if(sum >= 10)
			{
				sum -= 10;
				numA[i - 1] += 1;
			}
			
			numA[i] = sum + '0';
		}
		
		if(numA.size() > 80)
		{
			cout << "overflow" << endl;
			continue;
		}
		if(numA.size() == 80 && numA[0] != '0')
		{
			cout << "overflow" << endl;
			continue;
		}
		
		for(int i = 0; i < numA.size(); ++i)
		{
			if(i == 0 && numA[i] == '0') continue;
			cout << numA[i];
		}
		
		cout << endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>  
 
using namespace std;
 
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define repr(i, j) for(int i = j; i >= 0; --i)
#define INF (1 << 30)
#define MOD 1e9 + 7
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

int main() {
	int N;
	scanf("%d", &N);
	rep(i, N) {
		string a, b;
		string ans;
		cin >> a >> b;
		int a_tmp, b_tmp;
		int k = (a.size() > b.size()) ? a.size() : b.size();
		int tmp = abs(a.size() - b.size());
		rep(j, tmp) (a.size() > b.size()) ? b.insert(0, "0") : a.insert(0, "0");
		int keta = 0;
		repr(j, k - 1) {
			a_tmp = a[j] - 48; b_tmp = b[j] - 48;
			int sum = a_tmp + b_tmp + keta;
			if(sum < 10) {
				keta = 0;
				stringstream ss;
				ss << sum;
				ans.insert(0, ss.str());
			}
			else {
				keta = 1;
				sum = sum - 10;
				stringstream ss;
				ss << sum;
				ans.insert(0, ss.str());
			}
		}
		if(keta == 1) ans.insert(0, "1");
		if(ans.size() > 80) printf("overflow\n");
		else cout << ans << endl;
	}
	return 0;
}