Go: package main

import (
        "fmt"
        "bufio"
        "os"
)

func main() {
        var n int
        var a, b string
        sc := bufio.NewScanner(os.Stdin)
        fmt.Scanf("%d", &n)
        for i := 0; i < n; i++ {
                sc.Scan()
                a = sc.Text()
                sc.Scan()
                b = sc.Text()

                if len(a) > len(b) {
                        s := add(a, b)
                        if s[len(a)] > 0 {
                                if len(a) >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i <= len(a);i++ {
                                                fmt.Printf("%d", s[len(a)-i])
                                        }
                                }
                                fmt.Printf("\n")
                        } else {
                                if len(a)-1 >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i < len(a);i++ {
                                                fmt.Printf("%d", s[len(a)-i-1])
                                        }
                                }
                                fmt.Printf("\n")
                        }
                } else {
                        s := add(b, a)
                        if s[len(b)] > 0 {
                                if len(b) >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i <= len(b);i++ {
                                                fmt.Printf("%d", s[len(b)-i])
                                        }
                                }
                                fmt.Printf("\n")
                        } else {
                                if len(b)-1 >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i < len(b);i++ {
                                                fmt.Printf("%d", s[len(b)-i-1])
                                        }
                                }
                                fmt.Printf("\n")
                        }
                }
        }
}

// expects ln > lm
func add(n string, m string) (s [100]int) {
        ln := len(n)
        lm := len(m)
        var sum [100]int

        for i := 0; i < ln; i++ {
                var s, t int
                s = int(n[ln-1-i]) - int('0')

                if lm - 1 - i >= 0 {
                        t = int(m[lm-1-i]) - int('0')
                } else {
                        t = 0
                }

                sum[i+1] = (s + t + sum[i]) / 10
                sum[i] = (s + t + sum[i]) % 10
        }

        return sum
}

C++: #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string.h>
#include <queue>
#include <stack>
#include <utility>
#include <queue>
#define mp make_pair
#define pii pair<int,int> 
#define ff first
#define ss second

using namespace std;

int t,temp1,temp2,tempc;
char a[1000],b[1000];
int c[1000];

int addition(int n1,int n2)
{
	if(n1>=n2)
	{
		if(n2!=-1)
		{
			temp1=(int)a[n1]-48;
			temp2=(int)b[n2]-48;
			tempc=temp1+temp2;
			//printf("%d,%d,%d",temp1,temp2,tempc);
			if(tempc>=10)
			{
				tempc-=10;
				c[n1]+=1;
			}
			c[n1+1]+=tempc;
			//printf("%d,%d",c[n1+1],tempc);
			addition(n1-1,n2-1);
		}
		else if(n1!=-1)
		{
			tempc=(int)a[n1]-48;
			if(tempc>=10)
			{
				c[n1+1]-=10;
				c[n1]+=1;
			}
			c[n1+1]+=tempc;
			addition(n1-1,n2);
		}
	}
	else
	{
		addition(n2,n1);
	}
}

int main()
{
	scanf("%d",&t);
	while(t--)
	{
		scanf("%s",a);
		scanf("%s",b);
		for(int x=0;x<max(strlen(a),strlen(b))+5;x++)
		{
			c[x]=0;
		}
		if(strlen(a)>80||strlen(b)>80)
		{
			printf("overflow\n");
			continue;
		}
		else
		{
			addition(strlen(a)-1,strlen(b)-1);
			//printf("%d",(int)a[1]);
			//printf("%d,%d\n",strlen(a),strlen(b));
		}
		for(int z=0;z<max(strlen(a),strlen(b))+1;z++)
		{
			if(c[z]==0&&z==0)
			continue;
			printf("%d",c[z]);
		}
		printf("\n");
	}
	return 0;
}

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

#define DIGIT 100000

int main(void){
	char temp[1000];
	int a[100];
	int b[100];
	int c[100];
	int t;
	int n;

	scanf("%d", &n);
	for(int i=0; i<n; i++){
		for(int k=0; k<100; k++){
			a[k] = 0;
			b[k] = 0;
			c[k] = 0;
		}
		int j;
		scanf("%s", temp);

		for(int k=0, j=strlen(temp)-1; j>=0; k++){
			for(int l=0; l<5; l++, j--){
				if(j < 0) break;
				a[k] +=	(temp[j] - '0') * pow(10, l);
			}
		}

		scanf("%s", temp);
		for(int k=0, j=strlen(temp)-1; j>=0; k++){
			for(int l=0; l<5; l++, j--){
				if(j < 0) break;
				b[k] +=	(temp[j] - '0') * pow(10, l);
			}
		}

		for(j=0; j<100; j++){
			t = a[j] + b[j] + c[j];
			c[j] = t % DIGIT;
			c[j+1] += (t / DIGIT);
		}
		
		j=99;
		while(c[j] == 0 && j >= 0) j--;
		if(j == -1){
			printf("0\n");
		}else if(j > 15){
			printf("overflow\n");
		}else{
			printf("%d", c[j]);
			j--;
			for(; j>=0; j--){
				printf("%05d", c[j]);
			}
			printf("\n");
		}
	}

	return 0;
}

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[11];

	cin >> n;

	for (int nn = 0; nn < n; nn++){
		for (int i = 0; i < 10; i++){
			aa1[i] = 0;
			aa2[i] = 0;
			ans[i] = 0;
		}
		ans[10] = 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] >= 1){
				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]);
					}
				}
				if (flag == 0)cout << 0;
				cout << endl;
			}
		}

	}
	
	return 0;
}