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

int main(void){
	int n;
	cin >> n;
	for(int i=0; i<n; i++){
		string a, b;
		cin >> a >> b;
		if(a.size()>80 || b.size()>80) {cout << "overflow" << endl;}
		else{
			vector<int> x, y, z;
			for(int j=0; j<80; j++){
				x.push_back(0);
				y.push_back(0);
				z.push_back(0);
			}

			for(int j=0; j<a.size(); j++)
				x[j] = atoi( a.substr(a.size()-1-j,1).c_str() );
			for(int j=0; j<b.size(); j++)
				y[j] = atoi( b.substr(b.size()-1-j,1).c_str() );
			
			for(int j=0; j<80; j++){
				z[j] = x[j]+y[j];
			}
			for(int j=0; j<79; j++){
				if( z[j]>=10 ){
					z[j+1]++;
					z[j]-=10;
				}
			}
			if(z[79]>=10) {cout << "overflow" << endl;}
			else {
				bool zeroume = false;
				for(int j=0; j<80; j++){
					if(z[79-j]==0 && zeroume==false){}
					else{cout << z[79-j];zeroume=true;}
				}
				cout << endl;
			}
		}
	}
	return 0;
}

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


string solve(string s1, string s2){

while(s1.size()<85){
s1 = '0' + s1;
}
while(s2.size()<85){
s2 = '0' + s2;
}
string ret = "";
int kuri = 0;
for(int i=0;i<80;i++){
int r = (int)(s1[s1.size()-1-i]-'0' + s2[s2.size()-1-i]-'0') + kuri;
kuri = r/10;
r = r%10;
ret = ((char)('0'+r)) + ret;
}
if (kuri>0) return "overflow";
else{
string ret2 = "0";
for(int i=0;i<ret.size();i++){
if (ret[i]!='0'){ret2 = ret.substr(i);}
}
return ret2;
}
}

int main(void){
int N;
cin >> N;
for(int i=0;i<N;i++){
string s1, s2;
cin >> s1 >> s2;
cout << solve(s1, s2) << endl;
}
return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main() {
	int N;
	cin>>N;
	for(int i=0;i<N;i++) {
		string A,B,C;
		cin>>A>>B;
		reverse(A.begin(),A.end());
		reverse(B.begin(),B.end());
		for(int i=0;i<A.size()||i<B.size();i++) {
			int n=0;
			if(i<A.size())n+=(A[i]-'0');
			if(i<B.size())n+=(B[i]-'0');
			C.push_back(n);
		}
		for(int i=0;i<C.size();i++) {
			if(i!=C.size()-1)C[i+1]+=C[i]/10,C[i]%=10;
		}
		reverse(C.begin(),C.end());
		if(C.size()>80) {
			cout<<"overflow"<<endl;
		}else {
			for(int i=0;i<C.size();i++) {
				if(C[i]>=10) {
					cout<<(char)(C[i]/10+'0');
					cout<<(char)(C[i]%10+'0');
				}else cout<<(char)(C[i]+'0');
			}
			cout<<endl;
		}
	}
}

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

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 = (char*)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 = (char*)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;
}

C++: #include<iostream>
#include<algorithm>
#include<cstring>
#include<string>
#include<cstdio>
#define MOJI 48
using namespace std;
int multiple(string a,string b);
char c[111111];
int main(){
  int n;
  string a,b;
  while(cin >> n){
    for(int i=0;i<n;i++){
      cin >> a;
      cin >> b;
      int k = multiple( a , b );
      if(k>80){
	cout << "overflow" << endl;
      }else {
	for(int i=k-1;i>=0;i--){
	  printf("%d",c[i]);
	}
	cout << endl;
      }
    }
  }
}
int multiple(string a,string b){
  int a_size,b_size,w=0;
  char k = 0; // 桁上げ
  a_size = a.size();
  b_size = b.size();
  while(a_size>0 || b_size>0 || k == 1){
    if(a_size>0 && b_size>0){
      c[w] = (a[a_size-1] - MOJI + b[b_size-1] - MOJI + k) % 10;
      k = (k + (a[a_size-1]-MOJI) + (b[b_size-1]-MOJI)) / 10;
    }
    else if(a_size>0 && b_size<=0){
      c[w] = ((a[a_size-1]-MOJI) + k) % 10;
      k = (a[a_size-1]-MOJI + k) / 10;
    }
    else if(a_size<=0 && b_size>0){
      c[w] = (b[b_size-1] - MOJI + k) % 10;
      k = (k + b[b_size-1] - MOJI) / 10;
    }else {
      c[w] = k;
      k = 0;
    }
    a_size--;
    b_size--;
    w++;
  }
  return w;
}

C++: #include <cstdio>
#include <iostream>

using namespace std;

int main(void) {
	int sets;
	char input1[81], input2[81], out[81];
	int i1, i2, o, carry;
	int ic1, ic2;
	int i;

	cin >> sets;
	for(i=0;i<sets;i++) {
		scanf("%s", input1);
		scanf("%s", input2);
		for(i1=0;input1[i1] != '\0';i1++);
		for(i2=0;input2[i2] != '\0';i2++);
		i1--;i2--;o=0;carry=0;
		while(i1>=0 || i2>=0 || carry) {
			if(o > 80) { break; }
			if(i1>=0) { ic1 = input1[i1]-'0'; i1--; } else { ic1 = 0; }
			if(i2>=0) { ic2 = input2[i2]-'0'; i2--; } else { ic2 = 0; }
			if( ic1+ic2+carry < 10 ) { 
				out[o] = ic1+ic2+carry+'0';
				carry = 0;
			} else {
				out[o] = ic1+ic2+carry-10+'0';
				carry = 1;
			}
			o++;
		}
		if(o > 80) { cout << "overflow" << endl; }
		else { for(o--;o>=0;o--) { printf("%c", out[o]); } printf("\n"); }
	}

	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stack>
#include <set>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
#define ALL(v) v.begin(), v.end()

int getdigit2(long long a) {
    if (a == 0) return 1;
    int cnt = 0;
    while(a) {
        cnt++;
        a /= 10;
    }
    return cnt;
}


int main() {
    long long a, b;
    int n;
    cin >> n;
    REP(i,n) {
        cin >> a >> b;
        if (getdigit2(a) > 80 || getdigit2(b) > 80 || getdigit2(a + b) > 80) cout << "overflow" << endl;
        else {
            cout << a + b << endl;
        }
    }
    return 0;
}

C++: #include<stdio.h>
#include<string.h>
int main()
{
    char a[200],b[200];
    int c[200];
    int n,k;
    scanf("%d",&n);
    getchar();
    while(n--)
    {
        memset(a,0x00,sizeof(a));
        memset(b,0x00,sizeof(b));
        memset(c,0,sizeof(c));
        scanf("%s%s",a,b);
        int i,j,la,lb;
        la=strlen(a)-1;
        lb=strlen(b)-1;
        k=la>lb?la:lb;
        for(i=0; la>=0; i++,la--)
            c[i]+=a[la]-'0';
        for(i=0; lb>=0; i++,lb--)
        {
            c[i]+=b[lb]-'0';
            if(c[i]>=10)
            {
                c[i]-=10;
                c[i+1]+=1;
            }
        }
        while(c[i]!=0)
        {
            if(c[i]>=10)
            {
                c[i]-=10;
                c[i+1]+=1;
            }
            i++;
        }
        if(i>81)
            printf("overflow\n");
        else
        {
            for(j=i-1;j>=0;j--)
                printf("%d",c[j]);
            printf("\n");
        }
    }
    return 0;
}