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++: //#define _USE_MATH_DEFINES
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
//#include <iomanip>
#include <vector>
#include <string>
//#include <algorithm>
//#include <functional>
//#include <cmath>
//#include <time.h>

using namespace std;


int main(){

	int n, k1, k2, left, right, buf, flag;
	string s1, s2 , out;
	int aa1[10], aa2[10], ans[10];

	cin >> n;

	for (int i = 0; i < n; i++){
		for (int i = 0; i < 10; i++){
			aa1[i] = 0;
			aa2[i] = 0;
			ans[i] = 0;
		}
		flag = 0;

		cin >> s1 >> s2;
		k1 = s1.size();
		k2 = s2.size();

		if (k1 > 80 || k2 > 80){
			cout << "overflow" << endl;
		}
		else{
			buf = 8 - k1 % 8;
			for(int i = 0; i < buf; i++){
				s1.insert(0,"0");
			}
			buf = 8 - k2 % 8;
			for (int i = 0; i < buf; i++){
				s2.insert(0, "0");
			}
			left = s1.size()-8;
			for (int i = 0; i < 10; i++){
				aa1[i] = atoi(s1.substr(left, 8).c_str());
				left -= 8;
				if (left < 0)break;
			}
			left = s2.size() - 8;
			for (int i = 0; i < 10; i++){
				aa2[i] = atoi(s2.substr(left, 8).c_str());
				left -= 8;
				if (left < 0)break;
			}

			for (int i = 0; i < 10; i++){
				ans[i] += aa1[i] + aa2[i];
				if (ans[i] >= 100000000){
					ans[i + 1] += 1;
					ans[i] -= 100000000;
				}
			}
			if (ans[10] >= 100000000){
				cout << "overflow" << endl;
			}
			else{
				for (int i = 9; i >= 0; i--){
					if (flag == 0){
						if (ans[i] != 0){
							printf("%d",ans[i]);
							flag = 1;
						}
					}
					else{
						printf("%08d", ans[i]);
					}
				}
				cout << endl;
			}
		}

	}
	
	return 0;
}

C++: #include<stdio.h>
int nationalbudget(){
	int xsize=0,ysize=0,k=0;
	char x[101],y[101];
	scanf("%s",x);
	scanf("%s",y);
	for(int i=0;x[i]!='\0';i++){
		xsize++;
		if(i>79){
			printf("overflow\n");
			return 0;}}
	for(int i=0;y[i]!='\0';i++){
		ysize++;
		if(i>79){
			printf("overflow\n");
			return 0;}}
	if(xsize>=ysize){
		for(int i=0;i<xsize;i++){
			if(ysize-1-i>=0){
				int t=(x[xsize-1-i]-'0')+(y[ysize-1-i]-'0')+k;
				if(t>=10){
					if(i==79){
						printf("overflow\n");
						return 0;}
					else{
						k=1;
						t%=10;}}
				else k=0;
				x[xsize-1-i]=t+'0';}
			else{
				int t=(x[xsize-1-i]-'0')+k;
				if(t>=10){
					if(i==79){
						printf("overflow\n");
						return 0;}
					else{
						k=1;
						t%=10;}}
				else k=0;
				x[xsize-1-i]=t+'0';}}
		if(k==1)printf("1");
		for(int i=0;i<xsize;i++)printf("%c",x[i]);}
	else{
		for(int i=0;i<ysize;i++){
			if(xsize-1-i>=0){
				int t=(x[xsize-1-i]-'0')+(y[ysize-1-i]-'0')+k;
				if(t>=10){
					if(i==79){
						printf("overflow\n");
						return 0;}
					else{
						k=1;
						t%=10;}}
				else k=0;
				y[ysize-1-i]=t+'0';}
			else{
				int t=(y[ysize-1-i]-'0')+k;
				if(t>=10){
					if(i==79){
						printf("overflow\n");
						return 0;}
					else{
						k=1;
						t%=10;}}
				else k=0;
				y[ysize-1-i]=t+'0';}}
		if(k==1)printf("1");
		for(int i=0;i<ysize;i++)printf("%c",y[i]);}
	printf("\n");}
int main(){
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++)nationalbudget();
	return 0;}

C++: #include <cstdio>
#include <iostream>
#include <vector>
#include <cstring>
using namespace std;

int main(){
	int n;
	cin >> n;
	while( n-- > 0 ){
		string num1, num2;
		cin >> num1 >> num2;
		char sum[101];
		int degit = 0;
		for( int i = 0; i < 101; i++ ) sum[i] = '0';
		for( int i = 0; i < num1.size(); i++ ){
			sum[100-i] = num1[num1.size()-i-1];
		}
		int d;
		for( int i = 0; i < num1.size() || i < num2.size() || degit != 0; i++ ){
			int now;
			if( i < num2.size() ){
				now = (int)sum[100-i]-(int)('0') + (int)(num2[num2.size()-i-1]-(int)('0') + degit;
			}else{
				now = (int)sum[100-i]-(int)('0') + degit;
			}
			sum[100-i] = (char)(now%10)+'0';
			if( now >= 10 ) degit = 1;
			else degit = 0;
			d = i;
		}
		if( d < 80 ){
			for( int i = 100-d; i < 101; i++ ) cout << sum[i];
			cout << endl;
		}else{
			cout << "overflow" << endl;
		}
	}
}

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

int main(){

	int n;

	string a, b;
	char N1[80], N2[80];
	char sum[80], temp[81];
	string ans;

	cin >> n;

	for( int i=0;i<n;i++ ){

		cin >> a;
		
		if( a.length() >= 80 ){
			cout << "overflow" << endl;
			continue;
		}

		cin >> b;

		if( b.length() >= 80 ){
			cout << "overflow" << endl;
			continue;
		}

		for( int i=0;i<80;i++ ){
			N1[i] = -1; N2[i] = -1; sum[i] = 0;
		}

		for( int i=1;i<=a.length();i++ )
			N1[i] = a[a.length()-i] - '0';
		for( int i=1;i<=b.length();i++)
			N2[i] = b[b.length()-i] - '0';

		int over = 0;
		
		for( int i=0;i<80;i++ ){


			if( N1[i] == -1 && N2[i] == -1 ){
				if( over >= 10 ){
					sum[i] = over / 10;
					over = 0;
				}else
					sum[i] = -1;
				continue;
			}

			if( N1[i] != -1 )
				sum[i] += N1[i];
			if( N2[i] != -1 )
				sum[i] += N2[i];

			sum[i] += over / 10;

			over = floor((double)sum[i]/10)*10;

			sum[i] -= over;
			
		}

		if(over > 0)cout << "overflow" << endl;
		else{
			int j=0;
			for( int i=1;i<=80;i++ ){
				if( sum[80-i] >= 0 ){
					temp[j] = sum[80-i] + '0';
					j++;
					continue;
				}
				
			}
			temp[j] = '\0';

			cout << temp << endl;
		}

	}
	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>

using namespace std;


int main()
{
	int n;
	string buf1, buf2;
	vector<int> num1, num2;

	cin >> n;

	for ( int i = 0; i < n; i++ )
	{
		num1.clear();
		num2.clear();

		cin >> buf1;
		cin >> buf2;

		for ( unsigned int i = 0; i < buf1.size(); i++ )
		{
			num1.push_back( buf1[i] - '0' );
		}
		
		for ( unsigned int i = 0; i < buf2.size(); i++ )
		{
			num2.push_back( buf2[i] - '0' );
		}

		reverse( num1.begin(), num1.end() );
		reverse( num2.begin(), num2.end() );

		for ( unsigned int i = 0; i < num2.size(); i++ )
		{
			if ( i < num1.size() )
			{
				num1[i] += num2[i];
			}
			else
			{
				num1.push_back( num2[i] );
			}
		}

		for ( unsigned int i = 0; i < num1.size(); i++ )
		{
			if ( 10 <= num1[i] )
			{
				if ( i + 1 < num1.size() )
				{
					num1[i+1] += num1[i] / 10;
				}
				else
				{
					num1.push_back( num1[i] / 10 );
				}
				
				num1[i] %= 10;
			}
		}

		if ( num1.size() < 80 )
		{
			for ( vector<int>::reverse_iterator it = num1.rbegin(); it != num1.rend(); it++ )
			{
				cout << *it;
			}
		}
		else
		{
			cout << "overflow";
		}
		cout << endl;
	}

	return 0;
}