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 <vector>
#include<string>
#include<sstream>

#define CAPACITY 9

 
namespace stoi{
 
    int stoi(std::string str){
        int ret;
        std:: stringstream ss;
        ss << str;
        ss >> ret;
        return ret;
    }
 
}
class OverDigit{
 
public:
 
    int num_a[CAPACITY];
    int num_b[CAPACITY];
    OverDigit(std::string str_a, std::string str_b);
    void ChangeDigit(std::string str,int num[]);
    void Add();
};
 
OverDigit::OverDigit(std::string str_a,std::string str_b){
 
    ChangeDigit(str_a, num_a); 
    ChangeDigit(str_b, num_b);
 
}
 
void OverDigit::ChangeDigit(std::string str, int num[]){
 
    std::vector <int> num_str(CAPACITY, 0);
    int loc = CAPACITY, k = 8;
    int str_Max, str_rest;
 
    str_Max = str.length() / CAPACITY;//
    str_rest = str.length() % CAPACITY;
 
        for (int j = str.length() - CAPACITY; str_Max > 0; j = j-CAPACITY){
        num_str[k] = stoi::stoi(str.substr(j, CAPACITY));
        loc = k;
        k--;
        str_Max--;
    }
     
        if(str_rest!=0)num_str[loc - 1] = stoi::stoi(str.substr(0, str_rest));
 
    for (int j = 0; j < CAPACITY; j++){
    num[j]=num_str[j];
    }
}
//80?????????§?????¶???????
void OverDigit::Add(){
 
    int num_ans[CAPACITY] = {};
    int fat,overflow=0,count=0;
 
    for (int j = CAPACITY-1; j >0; j--){
        if (num_a[j] + num_b[j]<=999999999){
            num_ans[j] = num_a[j] + num_b[j];
        }
        else if (num_a[j] + num_b[j] > 999999999){
            fat = (num_a[j] + num_b[j]) - 1000000000;
            num_ans[j] = fat;
            num_a[j - 1]++;     
        }
 
    }
 
     if (num_a[0] + num_b[0] > 99999999){
        overflow = 1;
     }
     else{
         num_ans[0]= num_a[0] + num_b[0];
          
 
     }
 
    if (overflow == 1){
        std::cout << "overflow" << std::endl;
    }
    else {
        for (int j = 0; j < CAPACITY; j++){
            if (num_ans[j] != 0){
                count++;
                std::cout << num_ans[j];
 
            }
            else if (num_ans[j] == 0 && count >= 1){
                std::cout << "000000000";
            }
 
        }std::cout << std::endl;
    }
 
};
 
 
int main(){
    int N;
    std::string str_a, str_b;
 
    std::cin >> N;
    std::cin.ignore();
 
    for (int i = 0; i < N; i++){
        getline(std::cin, str_a);
        getline(std::cin, str_b);
        OverDigit OverDigit_a(str_a,str_b);
  //      OverDigit_a.Add();
    }
 
    return 0;
}

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

using namespace std;

void Swap(string&, string&);
vector<int> Atoi(string);

int main(){
  int i, j, n, a, b;
  vector<int> x, y, z;
  string s, t;

  cin >> n;

  for(i=0; i<n; ++i){
    cin >> s >> t;
    if(s.size() < t.size()) Swap(s, t);

    if(s.size() < 80){
      x = Atoi(s);
      y = Atoi(t);

      b = 0;
      for(j=0; j<y.size(); ++j){
	a = x[j] + y[j] + b;
	if(a >= 10){
	  a -= 10;
	  b = 1;
	}else{
	  b = 0;
	}
	z.push_back(a);
      }

      for(j=y.size(); j<x.size(); ++j){
	a = x[j] + b;
	if(a >= 10){
	  a -= 10;
	  b = 1;
	}else{
	  b = 0;
	}
	z.push_back(a);
      }
      if(b == 1) z.push_back(1);

      if(z.size() < 80){
	for(j=z.size()-1; j>=0; --j)
	  cout << z[j];
	cout << endl;
      }else{
	cout << "overflow" << endl;
      }

      x.clear();
      y.clear();
      z.clear();

    }else{
      cout << "overflow" << endl;
    }
  }
  return 0;
}

void Swap(string& s, string& t){
  string u;
  u = s;
  s = t;
  t = u;
}

vector<int> Atoi(string s){
  int i, n;
  vector<int> x;

  for(i=s.size()-1; i>=0; --i){
    n = s[i]-48;
    x.push_back(n);
  }

  return x;
}

C++: #include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <math.h>

using namespace std;
double a,b,c;
int input; 

int main()
{
	scanf("%d",&input);
	for(int loop=1;loop<=input;loop++)
	{
	scanf("%lf %lf",&a,&b);
	c=a+b;
	if(c<10^80&&a<10^80&&b<10^80)
	printf("%.0lf\n",c);
	else
	printf("overflow\n");
	}
	return 0;
}

C++: #include <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <map>
#define INF 100000000
#define rep(i,a) for(int i=0;i<(a);i++)

using namespace std;
typedef long long ll;


int main(){
    int n;
    cin>>n;
    
    rep(i,n){
        int x[100]={},y[100]={};
        string a,b;
        cin>>a>>b;
        for(int i=a.size()-1;i>=0;i--){
            x[a.size()-1-i]=a[i]-'0';
        }
        for(int i=b.size()-1;i>=0;i--){
            y[b.size()-1-i]=b[i]-'0';
        }
        int ans[100]={};
        for(int i=0;i<80;i++){
            ans[i]+=x[i]+y[i];
            ans[i+1]+=ans[i]/10;
            ans[i]-=ans[i]/10*10;
        }
        if(ans[80]!=0)cout<<"overflow"<<endl;
        else{
            bool flag=false;
            for(int i=79;i>=0;i--){
                if(ans[i]!=0)flag=true;
                if(flag)cout<<ans[i];
            }
        }
        cout<<endl;
        
    }
    return 0;
}

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

int strToInt(string str) {
  int ans = 0;
  for(int i = 0; i < str.length(); i++) {
    ans += ((int)str[i] - (int)'0') * (str.length() - i);
  }
  return ans;
}

int charToInt(char c) {
  return (int)c - (int)'0';
}

string sumStr(string a, string b) {
  int pa = a.length()-1, pb = b.length()-1;
  string str(81, '0');
  int pstr = str.length()-1;
  int next = 0;
  while(pa >= 0 && pb >= 0) {
    int temp = charToInt(a[pa]) + charToInt(b[pb]) + next;
    next = temp / 10;
    str[pstr] = (char)(temp%10+(int)'0');

    pa--;
    pb--;
    pstr--;
  }
  while(pa >= 0) {
    int temp = charToInt(a[pa]) + next;
    next = temp / 10;
    str[pstr] = (char)(temp%10+(int)'0');

    pa--;
    pstr--;
  }
  while(pb >= 0) {
    int temp = charToInt(b[pb]) + next;
    next = temp / 10;
    str[pstr] = (char)(temp%10+(int)'0');

    pb--;
    pstr--;
  }
  str[pstr] = (char)(next + (int)'0');

  for(int i = 0; i < str.length(); i++) {
    if(str[i] != '0') {
      return str.substr(i, str.length()-i);
    }
  }
  return "0";
}

int main(void) {
  int N;
  cin >> N;
  for(int i = 0; i < N; i++) {
    bool overflow = false;
    int data[N][8];
    string sum;
    for(int j = 0; j < 2; j++) {
      string str;
      cin >> str;

      if(!overflow) {
	if(j == 0) sum = str;
	else       sum = sumStr(sum, str);
        if(sum.length() > 80) overflow = true;
      }
    }

    if(overflow) cout << "overflow" << endl;
    else         cout << sum << endl;
  }
  return 0;
}