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 <string>
#include <sstream>
#include <deque>
class BigInt
{
  std::deque<char> m_digits;
public:
  BigInt(std::string str) {
    for(auto it = str.begin(); it != str.end(); ++it) {
      m_digits.push_back(*it - '0');
    }
  }

  BigInt(int num) {
    std::ostringstream oss;
    oss << num;
    BigInt(oss.str());
  }

  std::string str() const {
    std::string str;
    for (auto it = m_digits.begin(); it != m_digits.end(); ++it) {
      str += *it + '0';
    }
    return str;
  }

  const BigInt& operator +=(const BigInt& rhs) {
    std::deque<char> new_digits;
    auto lhs_rit = m_digits.rbegin();
    auto rhs_rit = rhs.m_digits.rbegin();

    char inc = 0;
    while (lhs_rit != m_digits.rend() &&
           rhs_rit != rhs.m_digits.rend()) {
      char temp = *lhs_rit + *rhs_rit;
      temp += inc;
      if (temp >= 10) {
        inc = temp / 10;
        temp -= inc * 10;
      }
      new_digits.push_front(temp);
      ++lhs_rit;
      ++rhs_rit;
    }

    if (lhs_rit != m_digits.rend()) {
      while (lhs_rit != m_digits.rend()) {
        char temp = *lhs_rit + inc;
        if (temp >= 10) {
          inc = temp / 10;
          temp -= inc * 10;
        }
        new_digits.push_front(temp);
        ++lhs_rit;
      }
    }
    else if (rhs_rit != rhs.m_digits.rend()) {
      while (rhs_rit != rhs.m_digits.rend()) {
        char temp = *rhs_rit + inc;
        if (temp >= 10) {
          inc = temp / 10;
          temp -= inc * 10;
        }
        new_digits.push_front(temp);
        ++rhs_rit;
      }
    }
    if (inc > 0) new_digits.push_front(inc);
    m_digits = new_digits;
  }
};

BigInt operator +(const BigInt& lhs, const BigInt& rhs)
{
  BigInt result(lhs);
  result += rhs;
  return result;
}

int main()
{
  int n;
  std::cin >> n;
  while (n--) {
    std::string num;
    std::cin >> num;
    BigInt num1(num);
    std::cin >> num;
    BigInt num2(num);
    
    BigInt num3 = num1 + num2;
    std::cout << num3.str() << std::endl;
  }
  return 0;
}

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

#define MAX_DIGIT 80


void add(char *buf1, char *buf2){
	int len1 = strlen(buf1);
	if(len1 > MAX_DIGIT){
		printf("overflow\n");
		return;
	}
	int len2 = strlen(buf2);
	if(len2 > MAX_DIGIT){
		printf("overflow\n");
		return;
	}
	
	int big1[MAX_DIGIT + 1] = {}, big2[MAX_DIGIT + 1] = {};
	
	for(int i = 0; i < len1; i++){
		big1[len1 - i - 1] = buf1[i] - 48;
	}
	for(int i = 0; i < len2; i++){
		big2[len2 - i - 1] = buf2[i] - 48;
	}
	
	int len = (len1 > len2) ? len1 : len2;
	for(int i = 0; i < len; i++){
		big1[i] += big2[i];
		if(big1[i] >= 10){
			big1[i + 1]++;
			big1[i] -= 10;
		}
	}
	
	int j = len;
	for(; j >= 0; j--){
		if(big1[j] > 0){
			break;
		}
	}
	if(j >= MAX_DIGIT){
		printf("overflow\n");
		return;
	}
	for(; j >= 0; j--){
		printf("%d", big1[j]);
	}
	printf("\n");
}

int main(){
	int n;
	
	scanf("%d", &n);
	for(int i = 0; i < n; i++){
		char buf1[101], buf2[101];
		scanf("%s", buf1);
		scanf("%s", buf2);
		add(buf1, buf2);
	}
	
	return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
    int n;
    for(cin>>n;n--;){
        int k=0;
        string a,b;
        cin >> a;
        cin >> b;
        if(a.size() < b.size()) swap(a,b);//????????????a>b?????????
        while(b.size() < a.size()) b = '0' + b;//????????????a==b?????????
        for(int i=a.size()-1;i>=0;i--){//???????????????????????????
            a[i] += b[i] - '0' + k;
            if(a[i] > '9'){
                a[i]-=10;
                k = 1;
            }
            else k = 0;
        }
        if(k)   a="1"+a;//??°??????????????????????????????????¶?????????¨???
        if(a.size() > 80)   cout << "overflow" << endl;
        else    cout << a << endl<<endl;
    }
    return 0;
}

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

int main(){
	int N;
	char str1[90], str2[90];
	int num1[80], num2[80], sum[80];
	int pos, pos2, up;
	
	scanf("%d", &N);
	for(int n = 0; n < N; n++){
		for(int i = 0; i < 90; i++){
			str1[i] = 0;
			str2[i] = 0;
		}
		for(int i = 0; i < 80; i++){
			num1[i] = 0;
			num2[i] = 0;
			sum[i] = 0;
		}
		scanf("%s", str1);
		scanf("%s", str2);
		
		pos = 89;
		while(str1[pos] == 0 && pos >= 0) pos--;
		pos2 = 0;
		while(str1[pos] != 0 && pos >= 0 && pos2 < 80){
			num1[pos2] = str1[pos] - 48;
			pos2++; pos--;
		}
		pos = 89;
		while(str2[pos] == 0 && pos >= 0) pos--;
		pos2 = 0;
		while(str2[pos] != 0 && pos >= 0 && pos2 < 80){
			num2[pos2] = str2[pos] - 48;
			pos2++; pos--;
		}
		
		/*for(int i = 0; i < 80; i++) printf("%d", num1[i]);
		printf("\n");
		for(int i = 0; i < 80; i++) printf("%d", num2[i]);
		printf("\n");*/
		
		up = 0;
		for(int i = 0; i < 80; i++){
			sum[i] = num1[i] + num2[i] + up;
			up = sum[i] / 10;
			sum[i] = sum[i] % 10;
		}
		
		if(up > 0 || sum[79] > 0) printf("overflow\n");
		else{
			pos = 79;
			while(sum[pos] == 0 && pos >= 0) pos--;
			if(pos < 0) printf("0");
			while(pos >= 0){
				printf("%d", sum[pos--]);
			}
			printf("\n");
		}
	}
	
	return 0;
}

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

int main() {
	ios :: sync_with_stdio(false);
	int t; cin >> t;
	while(t --) {
		int a[120];
		auto f = [&]() {
			string s; cin >> s;
			reverse(s.begin(), s.end());
			for(int i = 0; i < s.size(); i ++)
				a[i] += s[i] - '0';
		};
		f(); f();
		for(int i = 0; i + 1 < 120; i ++)
			if(a[i] >= 10) {
				a[i + 1] ++;
				a[i] -= 10;
			}
		int s = -1;
		for(int i = 0; i < 120; i ++)
			if(a[i]) s = i;
		if(s == -1)
			cout << 0 << '\n';
		else if(s >= 79)
			cout << "overflow\n";
		else {
			for(int i = s; i >= 0; i --)
				cout << a[i];
			cout << '\n';
		}
	}
	return 0;
}

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

int main(void)
{
	char str[2][1000];
	int b, s;
	int len[2];
	int i, j;
	int n;
	int flag;
	
	scanf("%d", &n);
	
	while (n){
		for (i = 0; i < 1000; i++){
			str[0][i] = str[1][i] = 0;
		}
		s = 1;
		b = 0;
		for (i = 0; i < 2; i++){
			scanf("%s", str[i]);
			len[i] = strlen(str[i]);
		}
		
		if (len[0] > 80 || len[1] > 80){
			printf("overflow\n");
		}
		else {
			if (len[0] < len[1]){
				s = 0;
				b = 1;
			}
			
			for (i = len[b], j = len[s]; i >= 0; i--, j--){
				if (j >= 0){
					str[s][i] = str[s][j];
				}
				else {
					str[s][i] = '0';
				}
			}
			
			flag = 0;
			i = len[b];
			while (i >= 0){
				if (str[s][i] + str[b][i] - '0' + flag > '9'){
					flag = 1;
				}
				else {
					flag = 0;
				}
				i--;
			}
			
			if (flag){
				for (i = len[b]; i >= 0; i--){
					for (j = 0; j < 2; j++){
						str[j][i + 1] = str[j][i];
					}
				}
				str[0][0] = '0';
				str[1][0] = '0';
			}
			
			for (i = len[b]; j >= 0; i--){
				str[b][i] += (str[s][i] - '0');
				if (str[b][i] > '9'){
					str[b][i] -= 10;
					str[b][i - 1]++;
				}
			}
			str[b][len[b] + flag] = '\0';
			
			printf("%s\n", str[b]);
		}
		
		n--;
	}
	
	return (0);
}