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 <bits/stdc++.h>
using namespace std;

int main(void) {
	string str1, str2;
	int i1, i2;	
	vector<char> v;
	vector<char>::iterator it;
	int n; 
	cin >> n;
	while (n--) {
		cin >> str1 >> str2;
		if (str1.length() > 80 || str2.length() > 80) {
			cout << "overflow\n"; 
			continue;
		}
		int up = 0, n1, n2;
		char c;
		v.clear();
		if (str1.length() < str2.length())
			swap(str1, str2);
		for (i1 = str1.length() - 1, i2 = str2.length() - 1;
				i2 >= 0; i1--, i2--) {
			n1 = str1[i1] - '0';
			n2 = str2[i2] - '0';
			n1 = n1 + n2 + up;
			up = n1 / 10;
			n1 = n1 % 10;
			c = (char)(n1 + '0');
			v.push_back(c);
		}
		while (i1 >= 0) {
			n1 = str1[i1] - '0';
			n1 = n1 + up;
			up = n1 / 10;
			n1 = n1 % 10;
			c = (char)(n1 + '0');
			v.push_back(c);
			i1--;
		}
		if (up == 1) {
			v.push_back('1');
		}
		if (v.size() > 80) {
			cout << "overflow" << endl;
			continue;
		}
		reverse(v.begin(), v.end());
		for (it = v.begin(); it != v.end(); it++) {
			cout << *it;
		}
		cout << endl;
	}
}

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

using namespace std;

int main(){
	int n,l1,l2,i;
	string a, b;
	char *ans;
	int ia,ib,sum;
	cin>>n;
	while(n--){
		cin>>a>>b;
		if(a.length()>80 || b.length()>80){
			cout<<"overflow"<<endl;
			exit(0);
		}
		if(a.length()==80 || b.length()==80){
			if((int)a[0]-'0'+(int)b[0]-'0'>9){
				cout<<"overflow"<<endl;
				exit(0);
			}
		}
		if(a.length()<b.length()){
			swap(a,b);
		}
		l1=a.length();
		l2=b.length();
		ans=new char[l1+1];
		for(i=0;i<l1;i++)ans[i]='0';
		for(i=1;i<l2+1;i++){
			ia=(int)a[l1-i]-(int)'0';
			ib=(int)b[l2-i]-(int)'0';
			sum=ia+ib;
			ans[l1-i]+=sum;
		}
		for(i=l2+1;i<l1+1;i++){
			ans[l1-i]=a[l1-i];
		}
		for(i=0;i<l1;i++){
			if(ans[i]-'0'>9){
				ans[i]=ans[i]-10;
				ans[i-1]+=1;
			}
		}
		for(i=0;i<l1;i++){
			cout<<(int)ans[i]-'0';
		}
		cout<<endl;
	}
	return 0;
}

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

int main(){
  string s,t, u;
  int n;
  char ch;

  cin >> n;
  for( int loop=0;loop<n;loop++ ){
    cin >> s >> t;

    //    cout << "\ns=" << s << endl << "t=" <<  t << endl;

    if( s.length()>80 || t.length()>80 ){
      cout << "overflow" << endl;
      continue;
    }

    while( s.length()>t.length() )
      t = "0" + t;
    while( t.length()>s.length() )
      s = "0" + s;
    /*
    cout << "s=" << s << " len=" << s.length() << endl;
    cout << "t=" << t << " len=" << t.length() << endl;
    */
    u="";
    int c=0;
    for( int i=s.length()-1;i>=0;--i ){
      int a = s[i]-'0';
      int b = t[i]-'0';
      int sum = a + b + c;
      if( sum>=10 ){
	sum-=10; c=1;
      }else
	c=0;
      ch = sum + '0';
      u = ch + u;
    }
    if( c==1 )
      u = "1" + u;

    if( u.length()>80 )
      cout << "overflow" << endl;
    else
      cout << u << endl;
  }
  return 0;
}

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


string F(string a,string b)
{
    int i=0,CF=0,JG=0,loop=0;
    string c;
    char *pa,*pb;
    if (a.length()>b.length())
    {
        b.insert(b.begin(),a.length()-b.length(),0x30);
    }
    else
    {
        a.insert(a.begin(),b.length()-a.length(),0x30);
    }
    pb=(char*)a.c_str()+a.length()-1;
    pa=(char*)b.c_str()+b.length()-1;
    for (i=0;i<a.length() || i<b.length();i++)
    {
        JG=(*pa--)+(*pb--)+CF-0x60;
        CF=JG/10;
        JG%=10;
        c.insert(c.begin(),1,JG+0x30);
    }
    if (CF)
    {
        if (i<a.length())
        {
            JG=*pa+CF-0x30;
            CF=JG/10;
            JG%=10;
            c.insert(c.begin(),1,JG+0x30);
        }
        else
        {
            c.insert(c.begin(),1,CF+0x30);
        }
    }
    return c;
}
int main()
{
    int N,i;
    cin>>N;
    string a,b,sum;
    for (i=1;i<=N;i++)
    {
        cin>>a>>b;
        sum=F(a,b);
        if(sum.length()>80)
            cout<<"overflow"<<endl;
        else
            cout<<sum<<endl;
    }
    return 0;
}

C++: #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define SORT(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
int main()
{
	int n;
	cin >> n;
	for(int j=0;j<n;j++)
	{
		string s1,s2;
		vector<int> ans;
		cin >> s1;
		cin >> s2;
		reverse(s1.begin(),s1.end());
		reverse(s2.begin(),s2.end());
		int k=0;
		int p=max(s1.size(),s2.size());
		int len1=s1.size(),len2=s2.size();
		s1.resize(p+2);
		s2.resize(p+2);
		for(int i=len1;i<p+2;i++)
		{
			s1[i]='0';
		}
		for(int i=len2;i<p+2;i++)
		{
			s2[i]='0';
		}
		ans.resize(p+2);
		for(int i=0;i<p+2;i++)
		{
			ans[i]=((s1[i]-'0')+(s2[i]-'0')+k)%10;
			if((s1[i]-'0')+(s2[i]-'0')+k>=10)k=1;
			else k=0;
		}
		vector<int>::iterator it=ans.end();
		it--;
		int r=0;
		while(*it==0)
		{
			ans.erase(it);
			r++;
			it--;
		}
		ans.resize(p+2-r);
		reverse(ans.begin(),ans.end());
		for(int i=0;i<ans.size();i++)
		{
			cout << ans[i];
		}
		cout << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include <algorithm>
#include<string.h>
#include <utility>
using namespace std;
using namespace std;
int main(){
	int m;
	string in,in2;
	int a[90],b[90],ans[90];
	int f;
	int a_len,b_len,m_len;
	cin>>m;
	while(m--){
		for(int i=0;i<90;i++){
			a[i]=b[i]=ans[i]=0;
		}
		cin>>in;
		cin>>in2;
		a_len=in.size();
		b_len=in2.size();
		for(int i=0;i<a_len;i++){
			a[a_len-1-i]=in[i]-'0';
		}
		for(int i=0;i<b_len;i++){
			b[b_len-1-i]=in[i]-'0';
		}
		m_len=max(a_len,b_len);
		if(m_len>80){
			cout<<"overflow"<<endl;
			continue;
		}
		f=0;
		for(int i=0;i<m_len+1;i++){
			ans[i]=(a[i]+b[i]+f)%10;
			f=(a[i]+b[i]+f)/10;
		}
		if(ans[m_len]!=0){
			//if(m_len>79){
				//cout<<"overflow"<<endl;
				//continue;
			//}
			//cout<<ans[m_len];
		}
		
		for(int i=0;i<m_len;i++){
			//cout<<ans[m_len-1-i];
		}cout<<endl;
		
		
	}
	return 0;
}

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

int main(){
	long n;
	cin>>n;
	while(n--){
		string a,b,ans;
		long tmp = 0,i;
		cin>>a>>b;
		while(a.size() != b.size()){
		if(a.size() > b.size()){
			while(a.size() != b.size()){
				b = '0' + b;
			}
		}

		else if(a.size() < b.size()){
			while(a.size() != b.size()){
				a = '0' + a;
			}
		}
		}

		reverse(a.begin(),a.end());
		reverse(b.begin(),b.end());

		for(i = 0;i < a.size()||i < b.size();i++){
			tmp = (int)(a[i] - '0') + (int)(b[i] - '0') + (int)tmp;
			ans = ((char)((tmp % 10)+'0')) + ans;

			tmp /= 10;
		}

		if((tmp + '0') != (char)'0')
			ans = (char)tmp + ans;

		if(ans.size() > 80)
			cout<<"overflow"<<endl;
		else
			cout<<ans<<endl;
	}
	return 0;
}