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 <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair<int, int> pint;
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define IREP(i, n) for(int i = (int)(n) - 1; i >= 0; i--)
#define ALL(x) (x).begin(), (x).end()
#define MOD 1000000007
#define IMAX INT_MAX
#define IMIN INT_MIN
#define LMAX LLONG_MAX
#define LMIN LLONG_MIN
template<typename T> inline void chmin(T &a, T b){ if(a > b) a = b; }
template<typename T> inline void chmax(T &a, T b){ if(a < b) a = b; }
template<typename T> inline void xch(T &a, T &b){ T w = a; a = b; b = w; }


int main() {
    int N;
    cin >> N;
    REP(notc, N){
        string s1, s2;
        cin >> s1;
        cin >> s2;
        int len1 = s1.length() - 1, len2 = s2.length() - 1;
        int n[90];
        int length = 0;
        REP(i, 90){
            n[i] = 0;
        }
        REP(i, 82){
            int a = (len1 - i >= 0)?s1[len1 - i] - '0':0;
            int b = (len2 - i >= 0)?s2[len2 - i] - '0':0;
            n[i] += a + b;
            n[i + 1] += n[i] / 10;
            n[i] %= 10;
            if(n[i] != 0) length = i + 1;
        }
        if(length >= 81){
            cout << "overflow" << endl;
        }
        else if(length == 0){
            cout << 0 << endl;
        }
        else{
            IREP(i, length){
            cout << n[i];
            }
            cout << endl;
        }
        
    }
    return 0;
}

C++: #include <stdio.h>
#include <string.h>

int main(){
int n,ans[100],kuri,i,j,ap,bp;
char a[1000],b[1000];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%s%s",a,b);
if(strlen(a)>80||strlen(b)>80){
printf("overflow\n");
continue;
}
ap=strlen(a)-1;
bp=strlen(b)-1;
j=0;
kuri=0;
while(ap>=0||bp>=0){
ans[j]=kuri;
if(ap>=0)ans[j]+=a[ap]- '0';
if(bp>=0)ans[j]+=b[bp]- '0';
kuri=ans[j]/10;
ans[j]%10;
j++;
ap--;
bp--;
}
if(kuri==1)ans[j]=1;
else j--;
if(j>=80){
printf("overflow\n");
continue;
}
for(;j>=0;j--){
printf("%d",ans[j]);
}
printf("\n");
}
return 0;
}

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

using namespace std;

/** Problem0015 : National Budget **/
int main()
{
	string a, b, s;
	int n, tmp, la, lb;
	bool up=false;
	
	cin >> n;
	for (int i=0; i<n; i++) {
		cin >> a >> b;
		s="";
		
		std::reverse(a.begin(), a.end());
		std::reverse(b.begin(), b.end());
		la=(int)a.length();
		lb=(int)b.length();
		
		if (la < lb) {
			swap(la, lb);
			swap(a, b);
		}
		
		for (int i = 0; i<la-lb; i++) b+='0';
		
		for (int i=0; i<la; i++) {
			tmp = (a[i]-'0') + (b[i] - '0') + (up?1:0);
			if (tmp>=10) {
				s += '0'+tmp%10;
				up = true;
			} else {
				s += '0'+tmp;
				up = false;
			}
		}
		
		if (up)
			s+='1';
		std::reverse(s.begin(), s.end());
		if (s.length()>80)
			cout << "overflow" << endl;
		else
			cout << s << endl;
	}
	return 0;
}

C++: #include<stdio.h>
#include<math.h>
#include<string.h>

int main(void){

	int N,math1,math2,kuri,keta;
	int i,j,k;
	char fi[100],se[100],ans[100];

	scanf("%d",&N);

	for(i=0;i<N;i++){

		scanf("%s",&fi);
		scanf("%s",&se);

		/*
		for(j=strlen(fi)-1,k=strlen(se)-1,keta=0,kuri=0;j>=0||k>=0;j--,k--,keta++){
			if(j<0) math1=0;
			else math1=fi[j]-'0';
			if(k<0) math2=0;
			else math2=se[k]-'0';
            ans[keta]=((math1+math2+kuri)%10)+'0';
			kuri=(math1+math2+kuri)/10;
		}
		if(kuri==1) printf("1");
		if(keta-1<=80){
			for(j=keta-1;j>=0;j--){
				printf("%c",ans[j]);
			}
		}
		
		else printf("overflow");
		*/
		printf("\n");
	}

	return 0;
}

C++: #include <iostream>
#include <cstring>
#include <cstdlib>
using namespace std;
const int DIGIT=9;

int main() {
  int n;
  char buf[90];
  int l, x[2], y, z;
  char buf_part[DIGIT+10];
  int a[2][10];
  int b[10];

  cin >> n;
  while (n--) {
    for (int i=0; i<2; i++) {
      cin >> buf;
      l = strlen(buf);
      x[i] = (l+DIGIT-1)/DIGIT;
      y = (l-1)%DIGIT+1;
      for (int j=0; j<9; j++) {
        a[i][j] = 0;
      }
      for (int j=0; j<x[i]; j++) {
        if (!j) {
          memcpy(buf_part, buf, y);
          buf_part[y] = '\0';
        } else {
          memcpy(buf_part, &buf[y+DIGIT*(j-1)], DIGIT);
          buf_part[DIGIT] = '\0';
        }
        a[i][x[i]-j-1] = atoi(buf_part);
      }
    }

    for (int i=0; i<9; i++) b[i] = 0;
    z = (x[0] > x[1]) ? x[0] : x[1];
    for (int i=0; i<z; i++) {
      b[i] = a[0][i] + a[1][i];
      if (b[i] >= 1000000000) {
        a[0][i+1]++;
        b[i] -= 1000000000;
      }
    }
    if (z<9 && a[0][z]) {
      b[z] = a[0][z]+a[1][z];
      ++z;
    }
    if (b[8] >= 100000000) {
      cout << "overflow" << endl;
    } else {
      cout << b[z-1];
      for (int i=z-2; i>=0; i--) {
        cout.fill('0');
        cout.width(DIGIT);
        cout << b[i];
      }
      cout << endl;
    }
  }
  return 0;
}

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

std::string add(std::string,std::string);

int main(){
  std::string n,m;
  int size;
  std::cin>>size;
  std::vector<std::string> sums;
  for(int i=0;i<size;++i){
    std::cin>>n>>m;
    std::string sum = add(n,m);
    if(sum.length()<=80)
      sums.push_back(sum); 
    else
      sums.push_back("overflow"); 
  }

  for(auto s:sums)
    std::cout<<s<<std::endl;

  return 0;
}

std::string add(std::string n,std::string m){
  if(n.length()>m.length()) std::swap(n,m);
  std::reverse(n.begin(),n.end());
  std::reverse(m.begin(),m.end());
  std::string sum;
  char c=0,s,t;
  for(int i=0;i<m.length()||c==1;++i){
    t = (i<n.length()?n[i]-'0':0)+(i<m.length()?m[i]-'0':0)+c;
    s = t%10;
    c = t/10;
    sum.push_back(s+'0');
  }
  
  std::reverse(sum.begin(),sum.end());
  sum.push_back('\0');
  return sum;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(void){
	int n;
	string s,t,ans;
	int nn,mm;
	int i,j,k;
	int flg[101];
	int x,y,z;
	cin>>n;
	for(i=0;i<n;i++){
		cin>>s>>t;
		reverse(s.begin(),s.end());
		reverse(t.begin(),t.end());
		for(j=0;j<max(s.size(),t.size());j++)	flg[j]=0;
		if(s.size()>t.size()){
			nn=s.size()-t.size();
			for(j=0;j<nn;j++)	t+='0';
		}
		else{
			nn=t.size()-s.size();
			for(j=0;j<nn;j++)	s+='0';
		}
		ans.clear();
		for(j=0;j<s.size();j++){
			x=s[j]-'0';
			y=t[j]-'0';
			z=x+y+flg[j];
			flg[j+1]=z/10;
			ans+=z%10+'0';
		}
		if(flg[s.size()]>0)		ans+=flg[s.size()]+'0';
		if(ans.size()>80)	cout<<"overflow"<<endl;
		else{
			reverse(ans.begin(),ans.end());
			cout<<ans<<endl;
		}
		//cout<<ans.size()<<endl;
	}
	return 0;
}