Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Scan()
	dataset, _ := strconv.Atoi(sc.Text())
	var firstdata *big.Int

	for i := 0; i < dataset*2; i++ {
		n := new(big.Int)
		sc.Scan()
		data, _ := n.SetString(sc.Text(), 10)

		if i%2 == 0 {
			firstdata = data
			continue
		}

		result := new(big.Int)
		if result := result.Add(data, firstdata); len(result.String()) > 80 {
			fmt.Println("overflow")
			continue
		} else {
			fmt.Println(result)
		}
	}
}

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

int main() {
   int n;
   string str_a;
   string str_b;
   string sum = "";

   scanf("%d", &n);
   for(int i=0; i < n; ++i){
       cin >> str_a >> str_b;

   int id_a = str_a.size();
   int id_b = str_b.size();
   int c = 0;

   // ???????????????????????°?????????????????????
   while (id_a > 0 || id_b > 0) {
     int a = 0, b = 0;
     // int??§??°???????????????
     if (id_a > 0) a = str_a[--id_a] - '0';
     if (id_b > 0) b = str_b[--id_b] - '0';
     // ?????¨???????????°???????????????c?????????????????????????????°???????????????
     sum = to_string(((a + b + c) % 10)) + sum;
     // ?¬???????????????°????????????????¨????
     c = (a + b + c) / 10;
   }
   if (c > 0) sum = to_string(c) + sum;
   cout << sum << endl;
   sum = "";
   }
}

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

using namespace std;

inline int toInt(string s) { int v; istringstream sin(s); sin>>v; return v; }
template<class T> inline string toString(T x){ ostringstream sout; sout<<x; return sout.str(); }

#define dump(x) cerr<<#x<<" = "<<(x)<<endl;
#define debug(x) cerr<<#x<<" = "<<(x)<<"(L"<<__LINE__<<")"<<" "<<__FILE__<<endl;

int main(){
	int N; cin >> N;
	for (int i = 0; i < N; i++) {
		string a, b; cin >> a >> b;
		if (a.size() < b.size()) {
			string tmp("");
			for (int j = 0; j < b.size()-a.size(); j++) { tmp += "0"; }
			a = tmp + a;
		} else if (b.size() < a.size()) {
			string tmp("");
			for (int j = 0; j < a.size()-b.size(); j++) { tmp += "0"; }
			b = tmp + b;
		}
		
		string res("");
		for (int j = 0; j < a.size()+1; j++) res += "0";
		a = "0"+a; b = "0"+b;
		for (int j = res.size()-1; j >= 0; j--) {
			int cur = 0;
			if (res[j] >= '0' && res[j] <= '9') {
				cur = res[j]-'0';
			}
			int ai = a[j]-'0', bi = b[j]-'0';
			int res_tmp = ai+bi+cur;
			if (res_tmp >= 10) { 
				res[j] = '0'+(res_tmp%10);
				res[j-1] = '0'+(res_tmp/10); 
			} else {
				res[j] = '0'+res_tmp;
			}
		}
		int j = 0;
		while (res[j] == '0') { j++; }
		string ans("");
		for (; j < res.size(); j++) ans += res[j];
		
		if (ans.size() > 80) {
			cout << "overflow" << endl;
		} else {
			cout << ans << endl;
		}
	}

	return 0;
}

C++: #include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>


using namespace std;

int main()
{
	int n;
	scanf("%d", &n);
	for (int i = 0; i < n; ++i)
	{
		char a[81], b[81];
		scanf(" %s %s", a, b);
		int aa[80], bb[80];
		memset(aa, 0, sizeof(aa));
		memset(bb, 0, sizeof(bb));
		for (int j = 0; j < strlen(a); ++j)
			aa[j] = a[strlen(a)-j-1] - '0';
		for (int j = 0; j < strlen(b); ++j)
			bb[j] = b[strlen(b)-j-1] - '0';

		int sum[81];
		memset(sum, 0, sizeof(sum));
		for (int j = 0; j < 80; ++j)
		{
			sum[j] += aa[j]+bb[j];
			sum[j+1] = sum[j]/10;
			sum[j] %= 10;
		}
		if (sum[80])
			puts("overflow");
		else
		{
			int d;
			for (d = 80; sum[d] == 0; --d)
				;
			for (; d >= 0; --d)
				printf("%d", sum[d]);
			printf("\n");
		}
	}

	return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdlib>
#define DIGIT 80
using namespace std;

class largenum{
  int nums[DIGIT];
  bool overflow;
  int most;
public:
  largenum(){
    overflow=false;
    most=DIGIT-1;
    for(int i=0;i<DIGIT;i++)
      nums[i]=0;
  }
  bool isoverflow(){ return overflow;}
  friend ostream& operator<<(ostream &out,largenum &l);
  friend istream& operator>>(istream &is,largenum &l);
  friend largenum operator+(largenum l1,largenum l2);
};

largenum operator+(largenum l1,largenum l2){
  bool carry=false;
  largenum ans;
  for(int i=DIGIT-1;i>=0;i--){
    int tmp=l1.nums[i]+l2.nums[i]+carry;
    carry=bool((tmp)/10);
    ans.nums[i]=(tmp)%10;
  }
  for(int i=0;i<DIGIT;i++){
    if(ans.nums[i]!=0){
      ans.most=i;
      break;
    }
  }  
  ans.overflow=carry;
  return ans;
}

ostream& operator<<(ostream &out,largenum &l){
  for(int i=l.most;i<DIGIT;i++){
    out<<l.nums[i];
  }
  return out;
}

istream& operator>>(istream &is,largenum &l){
  string str;
  is>>str;
  if(str.size()>DIGIT){
    l.overflow=true;
  }
  for(int i=0;i<(int)str.size();i++){
    int index = DIGIT-str.size()+i;
    switch(str[i]){
    case '0':
      l.nums[index]=0;
      break;
    case '1':
      l.nums[index]=1;
      break;
    case '2':
      l.nums[index]=2;
      break;
    case '3':
      l.nums[index]=3;
      break;
    case '4':
      l.nums[index]=4;
      break;
    case '5':
      l.nums[index]=5;
      break;
    case '6':
      l.nums[index]=6;
      break;
    case '7':
      l.nums[index]=7;
      break;
    case '8':
      l.nums[index]=8;
      break;
    case '9':
      l.nums[index]=9;
      break;
    }
  }
 
  l.most=DIGIT-str.size();
  return is;
}

int main(){
  int num;
  cin>>num;
  while(num--){
    largenum a,b;
    cin>>a>>b;
    if(a.isoverflow() || b.isoverflow()){
      cout<<"overflow"<<endl;
      continue;
    }
    a = a+b;
    if(a.isoverflow()){
      cout<<"overflow"<<endl;
    }else{
      cout<<a<<endl;
    }
  }
  return 0;
}

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

// typedef std::vector<char> TLongInt;
// TLongInt Decode(const std::string& Code)
// {
//     std::vector<char> Value(100, 0);
//     for(int i = 0; i < Code.size(); ++i){
//         Value[i] = Code[Code.size() -1 -i] - '0';
//     }
//     return Value;
// }
// TLongInt Add(const TLongInt& A, const TLongInt& B)
// {
//     assert(A.size() == B.size());
//     TLongInt C(A.size(), 0);
//     int kuriagari = 0;
//     for(int i = 0; i < A.size(); ++i){
//         int V = A[i] + B[i] + kuriagari;
//         C[i] = V % 10;
//         kuriagari = V / 10;
//     }
//     return C;
// }

// void Print(const TLongInt& Value, std::ostream& out)
// {
//     bool Left = true???
//     for(int i = Value.size() - 1; i >= 0; --i){
//         if(Value[i] == 0 && Left) continue;
//         if(i >= 80){
//             out << "overflow" << std::endl;
//             return;
//         }
//         Left = false;
//         out << int(Value[i]);
//     }
//     if(Left) out << "0";
//     out << std::endl;
// }

char* add(const char* a, const char* b)
{
    int sizeA, sizeB, sizeX;
    int A, B, C;
    char* x;
    char* t;
    const char* ap;
    const char* bp;
    char* xp;
    C = 0;
    sizeA = strlen(a);
    sizeB = strlen(b);
    sizeX = (sizeA > sizeB ? sizeA : sizeB)+1;
    x = malloc(sizeX);
    ap = a + sizeA-1;
    bp = b + sizeB-1;
    xp = x + sizeX-1;
    
    while(xp >= x){
        A = ap < a ? 0 : *ap - '0';
        B = bp < b ? 0 : *bp - '0';
        *xp = '0' + (A + B + C) % 10;
        C = (A + B + C) / 10;
        ap--;
        bp--;
        xp--;
    }
    if (*x == '0'){
        t = malloc(sizeX - 1);
        strcpy(t, x + 1);
        free(x);
        return t;
    }
    return x;
}
int main()
{
    int N;
    scanf("%d", &N);
    for(int i = 0; i < N; ++i){
        char first[101];
        char second[101];
        scanf("%s", first);
        scanf("%s", second);
        if(strlen(first) > 80
        || strlen(second) > 80){
            printf("overflow\n");
            continue;
        }
        char* result = add(first, second);
        if(strlen(result) <= 80){
            printf("%s\n", result);
            free(result);
        }else{
            printf("overflow\n");
        }
    }
    return 0;
}