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 <vector>
    #include <string>
    #include <sstream>
     
    class BigInteger {
    	// use 18 digit a element
    	std::vector<uint64_t> splited_num_;
    public:
    	BigInteger(std::string str) {
    		set_data(str);
    	}
    	BigInteger(std::vector<uint64_t>&& splited_num) {
    		splited_num_ = std::move(splited_num);
    	}
    	BigInteger operator+(const BigInteger& rhs) {
    		return BigInteger(plus(splited_num_, rhs.get_data()));
    	}
    	std::vector<uint64_t> get_data() const {return splited_num_;}
    	std::string to_string() const {
    		std::string ret("");
    		const int size = splited_num_.size();
    		for (int i = 0; i < size; ++i) {
    			const uint64_t& n = splited_num_[size - i - 1];
    			ret += n == 0 ? "000000000000000000" : std::to_string(n);
    		}
    		return ret;
    	}
    private:
    	void set_data(const std::string& str) {
    		std::string sub;
    		int length = str.length();
    		while (length >= 18) {
    			int pos = length - 18;
    			sub = str.substr(pos, 18);
    			splited_num_.push_back(to_uint64(sub));
    			length -= 18;
    		}
    		if (length > 0) {
    			sub = str.substr(0, length);
    			splited_num_.push_back(to_uint64(sub));
    		}
		}
    	std::vector<uint64_t> plus(std::vector<uint64_t> lhs,
    						       std::vector<uint64_t> rhs) const {
    		std::vector<uint64_t> ret;
     		uint64_t carry = 0;
     		
     		const int max = std::max(lhs.size(), rhs.size());
     		const int min = std::min(lhs.size(), rhs.size());
     		// ensure that lhs.sizs() is larger than rhs.size()
     		if (lhs.size() < rhs.size()) {
     			std::swap(lhs, rhs);
     		}
     		// fit container size
     		for (int i = 0; i < (max - min); ++i) {
     			rhs.push_back(0);
     		}
     		
     		for (int i = 0; i < max; ++i) {
     			uint64_t sum = lhs.at(i) + rhs.at(i) + carry;
     			carry = sum / 1000000000000000000;
     			sum = sum % 1000000000000000000;
     			ret.push_back(sum);
     		}
     		if (carry > 0) {
     			ret.push_back(carry);
     		}
     		return ret;
    	}
    	uint64_t to_uint64(const std::string& str) const {
    		std::istringstream iss(str);
    		uint64_t ret = 0;
    		iss >> ret;
    		return ret;
    	}
    };
     
    int main() {
    	std::vector<BigInteger> ans_list;
    	int n;
    	std::cin >> n;
    	for (int i = 0; i < n; ++i) {
    		std::string str1, str2;
    		std::cin >> str1;
    		std::cin >> str2;
    		BigInteger bi1(str1);
    		BigInteger bi2(str2);
    		ans_list.push_back(bi1 + bi2);
    	}
    	
    	for (auto ans : ans_list) {
    		auto ans_str = ans.to_string();
    		std::cout << (ans_str.length() > 80 ? "overflow" : ans_str) << std::endl;
    	}
    }

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <cstring>
#include <functional>

using namespace std;

#define REP(i,a,b) for((i)=(a);(i)<(int)(b);(i)++)
#define rep(i,n) REP(i,0,n)
// BEGIN CUT HERE
#define foreach(itr,c) for(typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
// END CUT HERE

int main(){
  int i, n;

  cin >> n;
  while(n--){
    int fix = 0;
    string s1, s2, tmp, res;

    cin >> s1;
    if((int)s1.size() > 80) fix++;
    cin >> s2;
    if((int)s2.size() > 80) fix++;

    vector<int> a(1000,0);
    rep(i,s1.size()) a[i] = s1[(int)s1.size()-1-i] - '0';
    vector<int> b(1000,0);
    rep(i,s2.size()) b[i] = s2[(int)s2.size()-1-i] - '0';

    rep(i,1000){
      int sum = a[i] + b[i];
      if(sum >= 10){ sum %= 10; a[i+1]++;}
      tmp += sum + '0';
    }

    reverse(tmp.begin(), tmp.end());
    bool f = false;
    rep(i,tmp.size()){
      if(tmp[i] != '0') f = true;
      if(f) res += tmp[i];
    }

    if((int)res.size() > 80) fix++;
    if(fix) cout << "overflow" << endl;
    else cout << res << endl;
  }

  return 0;
}