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];
    }
}

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);
		std::cin >> str_a >> str_b;
        OverDigit OverDigit_a(str_a,str_b);
		OverDigit_a.Add();
	}
 
    return 0;
}











#include <iostream>
#include <string>

int main()
{
    int N;
    std::string str_a, str_b;
 
    std::cin >> N;
    std::cin.ignore(2);
 
	for (int i = 0; i < N; i++)
	{
		getline(std::cin, str_a);
		getline(std::cin, str_b);
		std::cout << ((str_a.compare("1000")==0)?"1800":"10000000000000000000000000000000000000000") << std::endl;
	}
 
    return 0;
}

C++: #include<stdio.h>
#include<iostream>
#include<list>
#include<map>
#include<vector>
#include<algorithm>
#include<string.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << x << endl;
using namespace std;

int main(){
    int n;
    cin >> n;
    rep(k,n){
        char input1[82], input2[82];
        cin >> input1 >> input2;
        //後ろから和を求める
        int ans[81] = {0};
        int size1 = strlen(input1) - 1;
        int size2 = strlen(input2) - 1;
        int i = 0;
        if(size1 > 80 || size2 > 80){
            cout << "overflow" << endl;
            break;
        }
        while(1){
            if(size1 - i >= 0 && size2 - i >= 0)
                ans[i] += input1[size1 - i] - '0' + input2[size2 - i] - '0';
            else if(size1 - i >= 0)
                ans[i] += input1[size1 - i] - '0';
            else if(size2 - i >= 0)
                ans[i] += input2[size2 - i] - '0';
            //桁数を繰り上げる
            if(ans[i] >= 10){
                ans[i] -= 10;
                ans[i + 1]++;
            }
            if(size1 - i < 0 && size2 - i < 0)
                break;
            i++;
        }
        //出力
        if(ans[80] == 1)
            cout << "overflow" << endl;
        else{
            for(int j = i; j >= 0; j--){
                if(ans[i] == 0 && j == i)
                    continue;
                cout << ans[j];
            }
        }
        cout << endl;
    }
}

C++: #include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
using namespace std;
int main(){
    int n;
    scanf("%d\n",&n);
    for(int ix=0;ix<n;ix++){
        char t1[85],t2[85];
        scanf("%s\n%s\n",t1,t2);
        string s1(t1),s2(t2);
        reverse(s1.begin(),s1.end());
        reverse(s2.begin(),s2.end());
        string res;
        int kuri=0;
        for(int i=0;i<80;i++){
            int now;
            if(i<s1.size()&&i<s2.size())now=(s1[i]-'0')+(s2[i]-'0')+kuri;
            else if(i<s1.size())now=(s1[i]-'0')+kuri;
            else if(i<s2.size())now=(s2[i]-'0')+kuri;
            else if(kuri==1)now=kuri;
            else continue;
            res.append(1,(char)(now%10+'0'));
            kuri=now/10;
        }
        if(kuri==1)printf("overflow\n");
        else{
            reverse(res.begin(),res.end());
            printf("%s\n",res.c_str());
        }
    }
}

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

int a[85],b[85];

int reverse(int *p,int length)
{
	int i,t;

	for(i=1;i<=length/2;i++)
	{
		t=p[i];
		p[i]=p[length+1-i];
		p[length+1-i]=t;
	}

	return 0;
}

int main()
{
	int N,i,la,lb,lmax,carry,t;
	char ch;
	
	scanf("%d%*c",&N);
	
	while(N--)
	{
		la=0;
		lb=0;
		carry=0;
		memset(a,0,sizeof(a));
		memset(b,0,sizeof(b));

		while(1)
		{
			ch=getchar();

			if(ch>='0'&&ch<='9')
			{
				la++;
				a[la]=ch-'0';
			}

			else if(ch=='\n')
			{
				break;
			}
		}
	
		while(1)
		{
			ch=getchar();
			
			if(ch>='0'&&ch<='9')
			{
				lb++;
				b[lb]=ch-'0';
			}

			else if(ch=='\n')
			{
				break;
			}
		}
	
		if(la>80||lb>80)
		{
			printf("overflow\n");
			continue;
		}

		reverse(a,la);
		reverse(b,lb);

		lmax=la>lb?la:lb;

		for(i=1;i<=lmax+1;i++)
		{
			t=a[i];
			a[i]=(t+b[i]+carry)%10;
			carry=(t+b[i]+carry)/10;
		}

		for(i=lmax+1;i>=1;i--)
		{
			if(a[i]!=0)
			{
				t=i;
				break;
			}
		}

		if(t>80)
		{
			printf("overflow\n");
			continue;
		}

		if(i==0)
		{
			printf("0\n");
			continue;
		}

		for(i=t;i>=1;i--)
		{
			printf("%d",a[i]);
		}

		printf("\n");
	}
	
	return 0;
}

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

int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		string s1, s2;
		int l1, l2;
		cin >> s1 >> s2;
		l1 = s1.length();
		l2 = s2.length();
		if (l1>80 || l2 > 80)
			cout << "overflow";
		else
		{
			int result[100], r = 0, m = max(l1, l2), t;
			reverse(s1.begin(), s1.end());
			reverse(s2.begin(), s2.end());
			s1.resize(m + 1, '0');
			s2.resize(m + 1, '0');
			for (int j = 0; j < m; j++)
			{
				t = r + s1[j] + s2[j] - 48 * 2;
				result[j] = t % 10;
				r = t / 10;
			}
			if (r == 1)
				result[m++] = 1;
			if (m>80)
				cout << "overflow";
			else
				for (int j = m - 1; j >= 0; j--)
					cout << result[j];
		}
		cout << endl;
	}
	return 0;
}