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++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
void solve();
main { solve(); return 0; }
// clang-format on

string f(string a, string b, int c) {
  if (!a.size()) return c ? string(1, c + '0') : "";
  int ia = a.back() - '0', ib = b.back() - '0';
  int s = ia + ib + c;
  c     = s / 10;
  a.pop_back(), b.pop_back();
  return f(a, b, c) + char(s % 10 + '0');
}

void solve() {
  int n;
  cin >> n;
  rep(_, n) {
    string a, b;
    cin >> a >> b;
    while (a.size() < b.size()) a = "0" + a;
    while (a.size() > b.size()) b = "0" + b;
    string x                      = f(a, b, 0);
    cout << (x.size() > 80 ? "overflow" : x) << endl;
  }
}

C++: #include<iostream>
#include<stdio.h>
#include <algorithm>
#include<string.h>
#include <utility>
using namespace std;
int main(){
	int m;
	string in,in2;
	int a[1000],b[1000],ans[1000];
	int f;
	int alen,blen,mlen;
	cin>>m;
	while(m--){
		for(int i=0;i<90;i++){
			a[i]=b[i]=ans[i]=0;
		}
		cin>>in;
		cin>>in2;
		alen=in.size();
		blen=in2.size();
		for(int i=0;i<alen;i++){
			a[alen-1-i]=in[i]-'0';
		}
		for(int i=0;i<blen;i++){
			b[blen-1-i]=in[i]-'0';
		}
		mlen=max(alen,blen);
		if(mlen>79){
			cout<<"overflow"<<endl;
			continue;
		}
		f=0;
		for(int i=0;i<mlen+1;i++){
			ans[i]=(a[i]+b[i]+f)%10;
			f=(a[i]+b[i]+f)/10;
		}
		if(ans[mlen]!=0){
			if(mlen>78){
				cout<<"overflow"<<endl;
				continue;
			}
			cout<<ans[mlen];
		}
		
		for(int i=0;i<mlen;i++){
			cout<<ans[mlen-1-i];
		}cout<<endl;
		
		
	}
	return 0;
}

C++: #include <stdio.h>
#include <string.h>
char a[82];
char b[82];
char s[82];
int main()
{
  int n,i,j,c,d;
  scanf("%d",&n);
  while(n>0){
    memset(a,0,sizeof(a));
    memset(b,0,sizeof(b));
    memset(s,0,sizeof(s));
    scanf("%s\n%s",&a,&b);
    i=strlen(a)-1;
    j=strlen(b)-1;
    c=0;
    d=0;
    while(i>=0 || j>=0) {
      if(i>=0 && j>=0){
	s[d++] = (((a[i]-'0')+(b[j]-'0')+c) % 10)+'0';
	c = ((a[i]-'0')+(b[j]-'0')+c) / 10;
	i--;j--;
      }else if(i>=0){
	s[d++] = (((a[i]-'0')+c) % 10)+'0';
	c = ((a[i]-'0')+c) / 10;
	i--;
      }else if(j>=0){
	s[d++] = (((b[j]-'0')+c) % 10)+'0';
	c = ((b[j]-'0')+c) / 10;
	j--;
      }
    }
    if(c!=0) s[d++] = c+'0';
    if(d>80) printf("overflow");
    else {
      for(d--;d>=0;d--){
	printf("%c",s[d]);
      }
    }
    printf("\n");
    n--;
  }
  return 0;
}

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

using namespace std;

string add(string a, string b){
//    cout << a << endl;
//    cout << b << endl;
    while(a.size() < b.size()) a.insert(0, "0");
    while(b.size() < a.size()) b.insert(0, "0");
//    cout << a << endl;
//    cout << b << endl;
    int n = a.size();
    string res(n, ' ');
    for (int i = n - 1, d = 0; i >= 0; --i){
        int p = a[i] - '0';
        int q = b[i] - '0';
        int r = p + q + d;
        d = r / 10;
        res[i] = r % 10 + '0';
        if (i == 0 && d != 0) res.insert(0, string(1, d + '0'));
//        cout << res << endl;
    }
    return res;
}

int main(){
    int Tc;
    cin >> Tc;
    while(Tc--) {
        string a, b;
        cin >> a >> b;
        string tmp = add(a, b);
        if(tmp.size() > 80) cout << "overflow" << endl;
        else cout << tmp << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
	string a,b;
	int c[100]={0};
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a>>b;
		if(a.size()>80||b.size()>80)
			cout<<"overflow"<<endl;
		else{
			int t;
			if(a.size()>=b.size())
				t=a.size();
			if(a.size()<b.size())
				t=b.size();
			for(int j=0;j<t;j++){
				if(j<a.size())
					c[j]+=a[a.size()-j-1]-'0';
				if(j<b.size())
					c[j]+=b[b.size()-j-1]-'0';
				if(c[j]>=10){
					c[j]-=10;
					c[j+1]=1;
				}
			}
			bool h=true;
			if(c[t]==1){
				if(t==79){
					cout<<"overflow"<<endl;
					h=false;
				}
				else
				    cout<<"1";
			}
			if(h==true){
			for(int j=t-1;j>=0;j--)
				cout<<c[j];
			cout<<endl;
			}
		}
	}
	return 0;
}

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

using namespace std;

int main(void) {
	int sets;
	char input1[100], input2[100], out[100];
	int i1, i2, o, carry;
	int ic1, ic2;
	int i;

	cin >> sets;
	for(i=0;i<sets;i++) {
		scanf("%s", input1);
		scanf("%s", input2);
		for(i1=0;input1[i1] != '\0';i1++);
		for(i2=0;input2[i2] != '\0';i2++);
		i1--;i2--;o=0;carry=0;
		while(i1>=0 || i2>=0 || carry) {
			if(o > 80) { break; }
			if(i1>=0) { ic1 = input1[i1]-'0'; i1--; } else { ic1 = 0; }
			if(i2>=0) { ic2 = input2[i2]-'0'; i2--; } else { ic2 = 0; }
			if( ic1+ic2+carry < 10 ) { 
				out[o] = ic1+ic2+carry+'0';
				carry = 0;
			} else {
				out[o] = ic1+ic2+carry-10+'0';
				carry = 1;
			}
			o++;
		}
		if(o > 80) { printf("overflow"); }
		else { for(o--;o>=0;o--) { printf("%c", out[o]); } }
		printf("\n"); 
	}

	return 0;
}

C++: #include<iostream>
#include<string>
#include<cmath>
#include<algorithm>
using namespace std;

int main(){

  string s,t,a,b;
  int n,k;

  cin >> n;

  for(int i=0;i<n;i++){
    cin >> s >> t;

    int z[1000] = {0},x[1000] = {0},c = 0,p = 0;

    for(int i=s.size()-1;i>=0;i--){
      x[p] = s[i] - 48;
      p++;
    }

    p = 0;
    for(int i=t.size()-1;i>=0;i--){
      z[p] = t[i] - 48;
      p++;
    }


    k = max(s.size(),t.size());

    for(int i=0;i<k;i++){
      x[i] += z[i];

      if(x[i] >= 10){
	if(i == k - 1) c = 1;
	x[i] -= 10;
	x[i + 1]++;
      }
    }

    cout << "a" << " " << k+c << endl;

    if(k+c > 80) cout << "overflow" << endl;

    else{
      for(int i=k+c-1;i>=0;i--) cout << x[i];
      cout << endl;
    }
  }
}