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>
using namespace std;

int main(){
	string a, b;
	vector<int> ans;
	int n, num, ai, bi, c=0;
	bool flag;

	cin >> n;
	
	for(int i=0 ; i<n ; i++){
		cin >> a >> b;
		flag = false;
		
		for(int j=0 ; j<100 ; j++){
			num = 0;
			ai = a.size()-j-1;
			bi = b.size()-j-1;
			if( ai<0 && bi<0 && c==0) break;
			
			if(ai>=0)num += a[ ai ] - 48;
			if(bi>=0)num += b[ bi ] - 48;
			ans.push_back( (num+c)%10 );
			if(num+c >= 10) c = 1;
			else c = 0;
		}
		if(ans.size()>80){
			flag = true;
		}
		if(flag){
			printf("overflow");
		}else{
			for(int j=ans.size()-1 ; j>=0 ; --j){
				printf("%d", ans[j]);
			}
		}
		printf("\n");
		ans.clear();
	}
	return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
string add(string A, string B);
int main() {
  int n;
  cin>>n;
  string a,b;
  for(int i=0;i<n;i++) {
    cin>>a;
    cin>>b;
    string s=add(a,b);
	cout<<s<<endl;
  }   
  return 0;
}
string add(string A, string B) {
  int  a_size=A.size()-1;
  int  b_size=B.size()-1;
  int end=-1;
  vector<int> tmp;
  int Dr=0;
  while(true) {
    if(a_size<0 ){
      end=0;
      break;
    }
    if(b_size<0){
      end=1;
      break;
    }
    int a=(int)A[a_size]-(int)'0';
    int b=(int)B[b_size]-(int)'0';
    int n=a+b+Dr;
    if(n>=10){
      tmp.push_back(n-10);
      Dr=1;
    }
    else{
      Dr=0;
      tmp.push_back(n);
    }
    a_size--;
    b_size--;
  }

  if(end==0) {
    for(int i= b_size;i>=0;i--){
      int n=(int)B[i]-int('0')+Dr;
      if(n>=10) {
	tmp.push_back(n-10);
	Dr=1;
      }
      else{
	tmp.push_back(n);
	Dr=0;
      }
    }
  }
  else if(end==1){
    for(int i=a_size;i>=0;i--){
      int n=(int)A[i]-int('0')+Dr;
      if(n>=10){
	tmp.push_back(n-10);
	Dr=1;
      }
      else{
	tmp.push_back(n);
	Dr=0;
      }
    }
  }
  if(Dr==1)
    tmp.push_back(1);
  if(tmp.size()>80)
    return "overflow";
  reverse(tmp.begin(),tmp.end());
  string S="";
  for(int i=0;i<(int)tmp.size();i++) 
    S+=to_string(tmp[i]);
  return S;
}

C++: //National Budget
#include<bits/stdc++.h>
using namespace std;

char n1[100], n2[100], ans[100];

void reverse(char n[100], int l, int r){
  if(l>=r)return;
  swap(n[l], n[r]);
  reverse(n, l+1, r-1);
}

void sum(int n, int m){
  int x1=(n>=strlen(n1) ? 0 : n1[n]-'0');
  int x2=(n>=strlen(n2) ? 0 : n2[n]-'0');
  int tmp=x1+x2+m;
  if(n==100 || (n>=strlen(n1) && n>=strlen(n2) && m==0))return;
  ans[n]=tmp%10+'0';
  sum(n+1, tmp/10);
}

int main(){
  int n;
  scanf("%d", &n);
  for(int i=0; i<n; i++){
    fill(ans, ans+99, '\0');
    scanf("%s", n1); scanf("%s", n2);
    reverse(n1, 0, strlen(n1)-1);
    reverse(n2, 0, strlen(n2)-1);
    sum(0, 0);
    if(strlen(ans)>80) printf("overflow\n");
    else{
      reverse(ans, 0, strlen(ans)-1);
      printf("%s\n", ans);
    }
  }

  return 0;
}

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;
  vector<int> ans;
  int num,ai,bi, c =0;
  bool f;
  string a, b;

  cin >> n;
  while(n--){
    cin >> a >> b;
    f = false;

    rep(i,100){
      num = 0;
      ai = a.size()-i-1;
      bi = b.size()-i-1;
      if(ai < 0 && bi < 0 && c == 0 ) break;

      if(ai >= 0) num += a[ai] - '0';
      if(bi >= 0) num += b[bi] - '0';
      ans.push_back((num + c) % 10);
      if(num+c >= 10) c = 1;
      else c = 0;
    }

    if(ans.size() > 80){
      f = true;
    }
    if(f) printf("overflow");
    else{
      for(int j = ans.size()-1; j >= 0; j--){
        printf("%d",ans[j]);
      }
    }
    printf("\n");
  }

  return 0;
}