Go: package main

import (
	"bufio"
	"fmt"
	"math/big"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func main() {
	scanner.Split(bufio.ScanWords)

	const maxCapacity = 512 * 1024
	buf := make([]byte, maxCapacity)
	scanner.Buffer(buf, maxCapacity)

	n := nextInt()
	maxint, _ := new(big.Int).SetString("100000000000000000000000000000000000000000000000000000000000000000000000000000000", 10)

	for i := 0; i < n; i++ {
		aStr := nextString()
		bStr := nextString()

		a, _ := new(big.Int).SetString(aStr, 10)
		b, _ := new(big.Int).SetString(bStr, 10)
		c := big.NewInt(0).Add(a, b)

		if c.Cmp(maxint) < 0 {
			fmt.Println(c)
		} else {
			fmt.Println("overflow")
		}
	}
}

C++: #include <iostream>
#include <iomanip>
#include <string.h>
#include <stdio.h>
using namespace std;

void checkArray(char str[])
// 配列の内容確認(テスト用)
{
	int size = strlen(str);
	for(int i = 0; i < size; ++i)
	{
		cout << "str[" << i << "]: " << str[i] << endl;
	}
}
void str_reverse(char s[])
// 文字列を反転する
{
     int i, l = strlen(s);
     char t;
     for(i = 0; i < l/2; i++) {
         t = s[i]; s[i] = s[l-i-1]; s[l-i-1] = t;
     }
}
char *add(char num1[], char num2[])
// 足し算した結果を文字列として返す
{
	char res[82];
	bool carry = false; //繰り上がりの有無
	int numlen1 = strlen(num1);
	int numlen2 = strlen(num2);
	int maxlen = (numlen1 > numlen2) ? numlen1 : numlen2;
	int flag1 = 0, flag2 = 0;

	str_reverse(num1);
	str_reverse(num2);

	for(int i = 0; i < maxlen+1; ++i){
		// '\n'以降は値を0とする
		if(num1[i] == '\0') flag1 = 1;
		if(num2[i] == '\0') flag2 = 1;
		res[i] = carry;
		if(!flag1) res[i] += num1[i]-48;
		if(!flag2) res[i] += num2[i]-48;
		res[i] = res[i] % 10 + 48;
		carry = ((num1[i]-48)+(num2[i]-48)+carry) / 10;
	}
	// 終端文字をつける
	if(res[maxlen] == '0')
		res[maxlen] = '\0';
	else res[maxlen+1] = '\0';

	// 元に戻す
	str_reverse(num1);
	str_reverse(num2);
	str_reverse(res);
	cout << res;
	return res;
}

int main() {
	int dataset;
	char num1[80];
	char num2[80];

	cin >> dataset; // データセットの個数

	for(int i = 0; i < dataset; ++i){
			// 80桁以下の数字を入力
			cin >> setw(80) >> num1;
			cin >> setw(80) >> num2;
			// 足し算した結果を表示
			add(num1, num2);
	}
}

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

int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string str1, str2, ans;
    cin >> str1 >> str2;
    int p1 = str1.length();
    int p2 = str2.length();
    int c = 0;
    while (p1 > 0 || p2 > 0) {
      int a = 0, b = 0;
      if (p1 > 0) {
        a = str1[--p1] - '0';
      }
      if (p2 > 0) {
        b = str2[--p2] - '0';
      }
      ans = to_string((a + b + c) % 10) + ans;
      c = (a + b + c) / 10;
    }
    if (c != 0) {
      ans = to_string(c) + ans;
    }
    if (ans.length() > 80) {
      cout << "overflow\n";
    } else {
      cout << ans << "\n";
    }
  }
  return 0;
}

C++: #include <boost/multiprecision/cpp_int.hpp>
#include <iostream>

int main() {
  using namespace std;
  namespace mp = boost::multiprecision;
  // 任意長整数型
  using Bint = mp::cpp_int;

  Bint UB = pow(Bint(10), 80);
  int n;
  cin >> n;
  while (n--) {
      Bint a, b;
      cin >> a >> b;
      Bint c = a + b;
      if (a >= UB || b >= UB || c >= UB) {
          cout << "overflow";
      } else {
          cout << c;
      }
      cout << endl;
  }
}

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

int reverse(string &s){
	int n = s.size(), n2 = n/2;
	for (int i=0; i<n2; i++){
		swap(s[i], s[n-1-i]);
	}
	return 0;
}

int main(void){
	int n;
	cin>>n;
	for (int i=0; i<n; i++){
		string s1, s2, s3="";
		cin>>s1>>s2;

		reverse(s1);
		reverse(s2);

		while (s1.size()<s2.size()) s1 += '0';
		while (s2.size()<s1.size()) s2 += '0';

		long c=0, stmp;
		for (int i=0; i<s1.size(); i++){
			stmp = s1[i]-'0'+s2[i]-'0'+c;
			c = stmp / 10;
			s3 += stmp%10 +'0';
		}
		if (c!=0) s3 += c + '0';

		reverse(s3);
		if (s3.size()>80)
			cout<<"overflow"<<endl;
		else
			cout<<s3<<endl;

	}
	return 0;
}

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

int main()
{
	string s1, s2, sum;
	int n;
	cin >> n;
	while (n--) {
		cin >> s1 >> s2;
		int len = max(s1.size(), s2.size());
		for (int i = 0; i < len; i++) {
			sum += "0";
		}
		// ?????????????????????????????????????????????'0'??§??°????????????
		if (s1.size() < s2.size()) {
			// s1????????????????????§s2.size()-s1.size()?????????'0'?????°????????????
			// ??????s1??????????????????
			string r_s1 = "";
			for (int i = s1.size() - 1; i >= 0; i--) {
				r_s1 += s1[i];
			}
			// r_s1???s2.size()-s1.size()?????????'0'???????????°??????
			for (int i = 0; i < s2.size() - s1.size(); i++) {
				r_s1 += "0";
			}
			// r_s1????????????????????????
			s1 = "";
			for (int i = r_s1.size() - 1; i >= 0; i--) {
				s1 += r_s1[i];
			}
		}
		else {
			// ??????s2??????????????????
			string r_s2 = "";
			for (int i = s2.size() - 1; i >= 0; i--) {
				r_s2 += s2[i];
			}
			// s1.size()-s2.size()?????????'0'??§????????°??????
			for (int i = 0; i < s1.size() - s2.size(); i++) {
				r_s2 += "0";
			}
			// r_s2??????????????????
			s2 = "";
			for (int i = r_s2.size() - 1; i >= 0; i--) {
				s2 += r_s2[i];
			}
		}
		
		int carry = 0;
		char s;
		for (int i = 0; i < len; i++) {
			if (carry == 0) {
				s = s1[s1.size() - 1 - i] - '0' + s2[s2.size() - 1 - i] - '0' + '0';
				if (s - '0' >= 10) {
					carry = 1;
					sum[len - 1 - i] = int((s - '0') % 10) + '0';
				}
				else {
					sum[len - 1 - i] = s;
				}
			}
			else {// carry over
				s = s1[s1.size() - 1 - i] - '0' + s2[s2.size() - 1 - i] - '0' + '0' + 1;
				if (s - '0' >= 10) {
					carry = 1;
					sum[len - 1 - i] = int((s - '0') % 10) + '0';
				}
				else {
					carry = 0;
					sum[len - 1 - i] = s;
				}
			}
		}

		cout << (carry == 1 ? "1" : "");
		for (int i = 0; i < len; i++) {
			cout << sum[i] - '0';
		}
		cout << endl;
	}
    return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include <limits.h>
#include <string>
#include <stdlib.h>
#include <iostream>
using namespace std;

int main() {
	int lop;
	for (cin >> lop; lop > 0; lop--) {
		string a; cin >> a;
		string b; cin >> b;
		string c, d;
		int dif = a.size() - b.size();
		bool kuri = 0;
		for (int lop = 0; lop < abs(dif); lop++) {
			d += '0';
		}
		if (dif > 0)
			b = d + b;
		if (dif < 0)
			a = d + a;
		for (int i = 0; i < a.size(); i++) {
			c += '\0';
		}
		for (int i = a.size()-1; i >= 0; i--) {
			c[i] = a[i] + b[i]+kuri-'0';
			//cout << "c["<<i<<"] = "<<c[i] << endl;
			kuri = 0;
			if (c[i] > '9') {
				c[i] -= 10;
				kuri = 1;
			}
			if (i == 0 && kuri == 1)
				c = '1' + c;
		}
		if (c.size() > 80)
			cout << "overflow\n";
		else
			cout << c << endl;
	}
	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 vi vector<int>
#define pb push_back
#define INF 999999999
//#define INF (1LL<<59)

string addString(string a,string b ){
	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;
		}
	}
	string ret = "";                        //??????????????°???0????¶????
	rep(i,ans.size()){
		if(ans[i]!='0'||i==ans.size()-1){
			ret = ans.substr(i,ans.size()-i);
			break;
		}
	}
	return ret;
}


int main(){
	int n;
	cin>>n;
	rep(i,n){
		string a,b;
		cin>>a>>b;
		cout<<addString(a,b)<<endl;
	}
}