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 <iterator>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

int debug = 0;

int main(void){
	int n;
	int i, j;
	int len, tmp, carry;
	string str1, str2, str3, hoge;
	vector<int> num1, num2, sum;

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


		//getline(cin, str1);
		cin >> str1;

		len = str1.size();
		for(j=0;j<len;j++){
			num1.push_back(str1[len - j - 1] - 48); //convert ascii to digit
			if(debug) cout << num1[j] << endl;
		}

		//getline(cin, str2);
		cin >> str2;

		len = str2.size();
		for(j=0;j<len;j++){
			num2.push_back(str2[len - j - 1] - 48); //convert ascii to digit
			if(debug) cout << num2[j] << endl;
		}
		
		len = max(num1.size(), num2.size());
		carry = 0;
		for(j=0;j<len;j++){
			if(num1.size() > (unsigned int)j && num2.size() > (unsigned int)j){
				tmp = num1[j] + num2[j] + carry;
			}else if(num1.size() <= j){
				tmp = num2[j] + carry;
			}else{
				tmp = num1[j] + carry;
			}
			sum.push_back(tmp % 10);
			if(tmp >= 10){
				carry = 1;
			}else{
				carry = 0;
			}
		}
		
		if(carry) sum.push_back(carry);

		if(debug){
			for(j=0;(unsigned int)j<sum.size();j++){
				cout << sum[j];
			}
			cout << endl;
		}

		if(sum.size() > 80){
			cout << "overflow" << endl;
		}else{
			tmp = sum.size();
			str3.reserve(tmp + 1);
			for(j=0;j<tmp;j++){
				str3 += sum[tmp - j - 1] + 48; //convert digit to ascii
			}
			cout << str3 << endl;
		}
		
		if(debug) while(1);
		num1.clear();
		num2.clear();
		sum.clear();
		str1.erase();
		str2.erase();
		str3.erase();
	}

	return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a) (a).begin(),(a).end()
#define pb emplace_back
#define INF (1e9+1)


//#define MAX_V 100001

//MultipleLengthNumber
class MLN{
private:
    string _value;
    
public:
    MLN( string str = "" ):_value(str){}
    
    MLN operator + (MLN obj) {  //verified AOJ0015
        string a = _value, b = obj._value;
        
        if(a.size()<b.size())swap(a,b);         //len(a)>len(b)???
        b = string(a.size()-b.size(),'0')+b;    //b????????????a??¨??????????????????????????????0??§?????????
        
        string ans = string(a.size()+1,'0');    //a?????????+1 ?????????0??§???????????????
        for(int i=(int)a.size()-1;i>=0;i--){    //?¶??????? & ??°????????????
            ans[i+1] += (a[i]-'0') + (b[i]-'0');
            if(ans[i+1]>='0'+10){
                ans[i] += 1;
                ans[i+1] -= 10;
            }
        }
        rep(i,ans.size()){  //??????????????°???0????¶????
            if(ans[i]!='0'||i==ans.size()-1){
                return MLN( ans.substr(i,ans.size()-i) );
            }
        }
        abort();
    }
    
    bool operator > (MLN obj){
        string a = _value, b = obj._value;
        if(a.size() > b.size())return true;
        if(a.size() < b.size())return false;
        
        rep(i,a.size()){
            if(a[i]==b[i])continue;
            if(a[i]>b[i])return true;
            else return false;
        }
        return false;
    }
    
    MLN operator % (MLN obj){
        string a = _value, b = obj._value;
        
        if(MLN(b)>MLN(a))return MLN(a);
        
        string now = a.substr(0,b.size());
        rep(i,a.size()-b.size()+1){
            
        }
        
        return MLN();
    }
    
    
    string value(){
        return _value;
    }
};


int main(){
    int n;
    cin>>n;
    
    rep(i,n){
        string a,b;
        cin>>a>>b;
        string res = (MLN(a)+MLN(b)).value();
        
        if(res.size()>80)cout<<"overflow"<<endl;
        else cout<<res<<endl;
    }
}