Go: package main

import (
        "fmt"
        "bufio"
        "os"
)

func main() {
        var n int
        var a, b string
        sc := bufio.NewScanner(os.Stdin)
        fmt.Scanf("%d", &n)
        for i := 0; i < n; i++ {
                sc.Scan()
                a = sc.Text()
                sc.Scan()
                b = sc.Text()

                if len(a) > len(b) {
                        s := add(a, b)
                        if s[len(a)] > 0 {
                                if len(a) >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i <= len(a);i++ {
                                                fmt.Printf("%d", s[len(a)-i])
                                        }
                                }
                                fmt.Printf("\n")
                        } else {
                                if len(a)-1 >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i < len(a);i++ {
                                                fmt.Printf("%d", s[len(a)-i-1])
                                        }
                                }
                                fmt.Printf("\n")
                        }
                } else {
                        s := add(b, a)
                        if s[len(b)] > 0 {
                                if len(b) >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i <= len(b);i++ {
                                                fmt.Printf("%d", s[len(b)-i])
                                        }
                                }
                                fmt.Printf("\n")
                        } else {
                                if len(b)-1 >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i < len(b);i++ {
                                                fmt.Printf("%d", s[len(b)-i-1])
                                        }
                                }
                                fmt.Printf("\n")
                        }
                }
        }
}

// expects ln > lm
func add(n string, m string) (s [100]int) {
        ln := len(n)
        lm := len(m)
        var sum [100]int

        for i := 0; i < ln; i++ {
                var s, t int
                s = int(n[ln-1-i]) - int('0')

                if lm - 1 - i >= 0 {
                        t = int(m[lm-1-i]) - int('0')
                } else {
                        t = 0
                }

                sum[i+1] = (s + t + sum[i]) / 10
                sum[i] = (s + t + sum[i]) % 10
        }

        return sum
}

C++: #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <climits>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <vector>
#include <queue>
#include <string>
#include <complex>
using namespace std;

#define rep(i,n) for(int i=0; i<n; i++)
#define repa(i,s,e) for(int i=s; i<=e; i++)
#define repd(i,s,e) for(int i=s; i>=e; i--)

typedef vector<int> vi;

int n;
string s1, s2;
char n1[81], n2[81], sum[81];

int main() {
	scanf("%d", &n);
	rep(i,n) {
		memset(n1, 0, sizeof(n1));
		memset(n2, 0, sizeof(n2));
		memset(sum, 0, sizeof(sum));

		cin>>s1>>s2;
		int l1 = s1.size();
		int l2 = s2.size();
		if(min(l1,l2) > 80) {
			printf("overflow\n");
			return 0;
		}

		rep(k,l1) n1[k] = s1[l1-k-1] - '0';
		rep(k,l2) n2[k] = s2[l2-k-1] - '0';

		char a = 0;
		rep(i,80) {
			char c = n1[i] + n2[i] + a;
			a = c / 10;
			sum[i] = c % 10;
		}

		if(sum[80] != 0) {
			printf("overflow\n");
			return 0;
		}

		bool start = false;
		repd(i,80,0) {
			if(sum[i] != 0) start = true;
			if(!start && sum[i] == 0) continue;
			printf("%d", sum[i]);
		}
		printf("\n");
	}
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int n;
	string a,b;
	cin >> n;
	while(n--) {
		cin >> a >> b;
		string ret = "";
		reverse(a.begin(),a.end());
		reverse(b.begin(),b.end());
		int a_len = a.size(),b_len = b.size();
		int num = max(a_len,b_len),carry = 0,v;
		char tmp[1];
		for(int i = 0; i < num; i++) {
			if(a_len <= i || b_len <= i) v = carry + (b_len <= i ? a[i] : b[i]) - '0';
			else v = carry + a[i] + b[i] - '0' * 2;
			carry = v / 10;
			sprintf(tmp,"%d",v % 10);
			ret += tmp;
		}
		sprintf(tmp,"%d",carry);
		if(carry != 0) ret += tmp;
		reverse(ret.begin(),ret.end());
		cout << (ret.size() > 80 ? "overflow" : ret) << endl;
	}
	return 0;
}

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;
}