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>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define all(a) a.begin(),a.end()
using namespace std;

/*int main(){
	int n;
	cin>>n;
	rep(i,0,n){
		string s1,s2;
		cin>>s1>>s2;

		if(s1.size()<s2.size()) swap(s1,s2);

		for(int j=s1.size()-1,k=s2.size()-1;j>=0;j--,k--){
			if(k>=0) s1[j]+=s2[k]-'0';
			if(s1[j]>'9'){
				s1[j]-=10;
				if(s2)
			}
			ans[j]=a%10;
			ans[j+1]=a/10;
			//cout<<" "<<j<<" "<<ans[j]<<endl;
		}
		if(ans[80]>0){
			cout<<"overflow"<<endl; return 0;
		}
		bool f=0;
		for(int i=80;i>=0;i--){
			if(f==0 && ans[i]>0){
				f=1; cout<<ans[i];
			}else if(f) cout<<ans[i];
		}
		cout<<endl;
	}
}*/

int main(){
    int n;
    cin>>n;
    rep(i,0,n){
        int ans[85]={};
        vector<int> n1(80,0),n2(80,0);
        //rep(j,0,81)cout<<n1[j]<<" "<<n2[j]<<endl;
        string s1,s2; 
        cin>>s1>>s2;
        //cout<<s1<<" "<<s2<<endl;
        int sz1=s1.size(),sz2=s2.size();
 
        //rep(j,0,sz1) n1[j]=s1[sz1-1-j]-'0';
        //rep(j,0,sz2) n2[j]=s2[sz2-1-j]-'0';
 		
 		reverse(all(s1));
 		reverse(all(s2));

        rep(j,0,s1.size()) n1[j]=s1[j]-'0';
        rep(j,0,s2.size()) n2[j]=s2[j]-'0';

        reverse(all(n1));
        reverse(all(n2));

        for(int j=79;j>=0;j--){
           // cout<<"  "<<j<<" "<<n1[j]<<" "<<n2[j]<<endl;
            ans[j]+=n1[j]+n2[j];
            if(ans[j]>9){
            	if(j>0) {
            		ans[j-1]=1;
            		ans[j]-=10;
            	}
            }
            //cout<<" "<<j<<" "<<ans[j]<<endl;
        }
        if(ans[0]>9){
            cout<<"overflow"<<endl; break;
        }
        bool f=0;
        for(int j=0;j<80;j++){
            if(f==0 && ans[j]>0){
                f=1; cout<<ans[j];
            }else if(f) cout<<ans[j];
        }
        cout<<endl;
    }
}

C++: #include <iostream>
#include <string>
#include <cstdio>
#include <algorithm>
#include <stdexcept>

class biglong {
	static const int part_digits = 8;
	static const int max_parts = 10;
	static const int max_digits = part_digits * max_parts;
	static const unsigned long max_part_value = 100000000;
	unsigned long parts[max_parts];
public:
	biglong(unsigned long value) : parts() { parts[0] = value; }
	biglong(const biglong& rhs) {
		std::copy(rhs.parts, rhs.parts + max_parts, parts);
	}
	explicit biglong(const std::string& rhs) : parts() {
		if (rhs.size() > max_digits) {
			throw std::overflow_error("biglong overflow");
		}
		int part_count = (static_cast<int>(rhs.size()) + part_digits - 1) / part_digits;
		int pos = static_cast<int>(rhs.size());
		for (int i = 0; i < part_count; ++i) {
			pos -= part_digits;
			if (pos < 0) {
				parts[i] = std::atol(rhs.substr(0, pos + part_digits).c_str());
			} else {
				parts[i] = std::atol(rhs.substr(pos, part_digits).c_str());
			}
		}
	}
	biglong& operator+=(const biglong& rhs) {
		for (int i = 0; i < max_parts - 1; ++i) {
			parts[i] += rhs.parts[i];
			if (parts[i] >= max_part_value) {
				parts[i] -= max_part_value;
				++parts[i + 1];
			}
		}
		parts[max_parts - 1] += rhs.parts[max_parts - 1];
		if (parts[max_parts - 1] >= max_part_value) {
			throw std::overflow_error("biglong overflow");
		}
		return *this;
	}
	std::string c_str() const {
		std::string result;
		for (int i = max_parts - 1; i >= 0; --i) {
			if (!result.empty() || parts[i] != 0) {
				char buff[12] = {};
				if (result.empty()) {
					sprintf(buff, "%lu", parts[i]);
				} else {
					sprintf(buff, "%0*lu", part_digits, parts[i]);
				}
				result += buff;
			}
		}
		if (result.empty()) {
			result = "0";
		}
		return result;
	}
};

biglong operator+(const biglong& lhs, const biglong& rhs)
{
	return biglong(lhs) += rhs;
}

std::ostream& operator<<(std::ostream& os, const biglong& value)
{
	return os << value.c_str();
}

int main()
{
	int count = 0;
	std::cin >> count;
	for (int i = 0; i < count; ++i) {
		std::string input1, input2;
		std::cin >> input1 >> input2;
		try {
			biglong value1(input1);
			biglong value2(input2);
			biglong sum = value1 + value2;
			std::cout << sum << std::endl;
		}
		catch (const std::overflow_error&) {
			std::cout << "overflow" << std::endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<string, ll> PS;
typedef vector<ll> V;

int k = 0, n;
string s, t;
vector<string> ans;

int main(){
	cin >> n;
	REP(j,n){
		cin >> s >> t;
		k = 0;
		if (s.size() >= 80 || t.size() >= 80)cout << "overflow" << endl;
		reverse(ALL(s));
		reverse(ALL(t));
		int a = max(s.size(), t.size()), b = min(s.size(), t.size());
		if (s.size() > t.size()){
			REP(i, a - b){
				t += "0";
			}
		}
		else{
			REP(i, a - b){
				s += "0";
			}
		}		
		reverse(ALL(s));
		reverse(ALL(t));
		REP(i, s.size()){
			int x = (s[s.size()-1-i] - '0') + (t[s.size()-1-i] - '0');
			string q;
			stringstream ss;
			if (i != s.size() - 1){
				ss << ((x + k) % 10);
			}
			else{
				ss << x + k;
			}
			ss >> q;
			ans.push_back(q);
			if (x + k >= 10){
				k = (x + k) / 10;
			}
			else{
				k = 0;
			}
		}
		if (ans.size() >= 79)cout << "overflow" << endl;
		//cout << ans.size() << endl;
		reverse(ALL(ans));
		REP(i, ans.size()){
			cout << ans[i];
		}
		cout << endl;
		ans.clear();
	}
}