Go: package main

import (
	"bufio"
	"fmt"
	"math/big"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func main() {
	scanner.Split(bufio.ScanWords)

	const maxCapacity = 512 * 1024
	buf := make([]byte, maxCapacity)
	scanner.Buffer(buf, maxCapacity)

	n := nextInt()
	maxint, _ := new(big.Int).SetString("100000000000000000000000000000000000000000000000000000000000000000000000000000000", 10)

	for i := 0; i < n; i++ {
		aStr := nextString()
		bStr := nextString()

		a, _ := new(big.Int).SetString(aStr, 10)
		b, _ := new(big.Int).SetString(bStr, 10)
		c := big.NewInt(0).Add(a, b)

		if c.Cmp(maxint) < 0 {
			fmt.Println(c)
		} else {
			fmt.Println("overflow")
		}
	}
}

C++: #include <stdio.h>

int main(void) {

  int n;

  char buf[100];

  int a[100],b[100];
  int result[100];
  
  int sum,carry;
  int idx1,idx2;
  int maxlen;

  int i,j;

  scanf("%d",&n);

  getchar();

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

    fgets(buf,sizeof(buf),stdin);

    idx1=0;

    while(buf[idx1]!='\n') {

      a[idx1]=buf[idx1]-48;

      idx1++;

    }

    //for(j=0;j<idx1;j++) printf("%d",a[j]);

    fgets(buf,sizeof(buf),stdin);

    idx2=0;

    while(buf[idx2]!='\n') {

      b[idx2]=buf[idx2]-48;

      idx2++;

    }

    if(idx1>idx2) maxlen=idx1;
    
    else maxlen=idx2;

    carry=0;

    for(j=0;j<maxlen;j++) {

      if(j<idx1 && j<idx2) sum=a[idx1-j-1]+b[idx2-j-1]+carry;

      else if(j>=idx1) sum=b[idx2-j-1]+carry;

      else sum=a[idx1-j-1]+carry;


      if(sum>=10) carry=1;

      else carry=0;

      result[j]=sum%10;

    }
    //printf("%d\n",carry);
    if(carry==1) {

      if(maxlen>=80) printf("overflow\n");

      else {

	printf("1");

	for(j=maxlen-1;j>=0;j--) {

	  printf("%d",result[j]);

	}

	putchar('\0');

	puts("");

      }

    }

    else {

      for(j=maxlen-1;j>=0;j--) {

	printf("%d",result[j]);

      }

      puts("");

    }

  }

  return 0;

}

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

using namespace std;

int main() {

	string a;
	string b;
	int kari;

	cin >> kari;

	for (int o = 0; o < kari; o++) {
		int c[80] = {0};
		int d[80] = {0};
		int e[81] = {0};
		int counter;

		cin >> a;
		cin >> b;
	
		if (a.size() > 80 || b.size() > 80) {
			cout << "overflow" << endl;
			continue;
		} else {
			for (int i = a.size() - 1; i >= 0; i--) {
				c[a.size() - 1 - i] = a[i] - '0';
			}

			for (int i = b.size() - 1; i >= 0; i--) {
				d[b.size() - 1 - i] = b[i] - '0';
			}

			for (int j = 0; j < 80; j++) {
				e[j] += c[j] + d[j];
				if (e[j] >= 10) {
					e[j+1] = e[j] / 10;
					e[j] = e[j] % 10;
				} 
			}
		}

		if (e[80] > 0) {
			cout << "overflow" << endl;
		} else {
			for (int k = 79; k >= 0; k--) {
				if (e[k] != 0) {
					counter = k;
					break;
				}
			}
			for (int k = counter; k >= 0; k--) {
				cout << e[k];
			}

			cout << endl;
		}
	}
	return 0;
}

C++: #include<iostream>
int main(){
	int n;
	long long int a,b;
	std::cin>>n;
	while(n>0){
		std::cin>>a>>b;
		std::cout<<a+b<<std::endl;
		n--;
	}
	return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#define M_PI 3.14159265358979
#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include<iomanip>
#include<vector>
#include<cmath>
#include <algorithm>

using namespace std;



int main(){
	int n;
	string x, y;
	int a, b, c;
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> x >> y;
		if (x.length() > 80 || y.length() > 80){
			cout << "overflow" << endl;
		}
		else
		a = stoi(x);
		b = stoi(x);
		if (to_string(a + b).length() > 80){
			cout << "overflow" << endl;
		}
		else cout << a + b << endl;
	}
	return 0;
}

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

int main(){
    int n,x=0,i;
    cin>>n;
    while(n--){
        x=0;
        string a,b,c="";
        cin>>a>>b;
        if(a.length()>80||b.length()>80){
            cout<<"overflow"<<endl;
            continue;
        }
        if(a.length()>b.length())swap(a,b);
        b='0'+b;
        while(a.length()<b.length())
            a='0'+a;
        char m;
        for(i=a.length()-1;i>0;i--){
            m=('0'+(a[i]-'0'+b[i]-'0'+x)%10);
            x=(a[i]-'0'+b[i]-'0'+x)/10;
            c=m+c;
        }
        if(x>0){
            m=('0'+x);
            c=m+c;
        }
        if(c.length()>80)
            cout<<"overflow"<<endl;
        else cout<<c<<endl;
    }
}

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

int main(){
	int x[100];
	int y[100];
	int z[100];
	int n, i, j, hi;
	bool top;
	string a, b;
	
	cin >> n;
	for (i = 0; i < n; i++) {
		// initialize
		for(j=0; j<100; j++){
			x[j] = 0;
			y[j] = 0;
			z[j] = 0;
		}
		cin >> a;
		cin >> b;
		for (j = 0; j < a.length(); j++){
			x[j] = atoi(a.substr(a.length()-1-j, 1).c_str());
		}
		for (j = 0; j < b.length(); j++){
			y[j] = atoi(b.substr(b.length()-1-j, 1).c_str());
		}
		
		hi = 0;
		for(j=0; j<80; j++){
			z[j] = x[j] + y[j] + hi;
			if(z[j] > 9){
				hi = 1;
				z[j] -= 10;
			}else{
				hi = 0;
			}
		}
		if(hi == 1){
			cout << "overflow" << endl;
		}else{
			top = false;
			for (j = 79; j > -1; j--) {
				if(z[j] == 0 && !top){
					continue;
				}else{
					top = true;
					cout << z[j];
				}
			}
			cout << endl;
		}
	}
	return 0;
}

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

using namespace std;

int main() {
    int n;
    cin >> n;
    while (n--) {
        int len, keta = 0;
        string a, b, c = "";
        cin >> a >> b;
        reverse(a.begin(), a.end());
        reverse(b.begin(), b.end());
        len = max(a.size(), b.size());
        for (int i = 0, size = len - a.size(); i < size; i++) {
            a += '0';
        }
        for (int i = 0, size = len - b.size(); i < size; i++) {
            b += '0';
        }
        for (int i = 0; i < len; i++) {
            c += ((a[i] - '0') + (b[i] - '0') + keta) % 10 + '0';
            keta = ((a[i] - '0') + (b[i] - '0') + keta) / 10;
        }
        if (keta == 1) {
            c += '1';
        }
        reverse(c.begin(), c.end());
        cout << c << endl;
    }
    
    return 0;
}

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

int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		string s1, s2;
		int l1, l2;
		cin >> s1 >> s2;
		l1 = s1.length();
		l2 = s2.length();
		if (l1>80 || l2 > 80)
			cout << "overflow" << endl;	
		else
		{
			int result[100], r = 0, m = max(l1, l2);
			reverse(s1.begin(), s1.end());
			reverse(s2.begin(), s2.end());
			for (int j = 0; j < m; j++)
			{
				s1.resize(m + 1, '0');
				s2.resize(m + 1, '0');
				int t = s1[j] + s2[j] - 48 * 2;
				result[j] = r + t % 10;
				r = t / 10;
			}
			if (r == 1)
				result[m++] = 1;
			for (int j = m - 1; j >= 0; j--)
				cout << result[j];
		}
		cout << endl;
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
short sum[5011][5011];
int main(){
  int N, M;
  cin >> N >> M;
  for(int i = 0; i < M; i++){
    int a, b, x;
    cin >> a >> b >> x;
    ++sum[a][b];
    --sum[a][b + 1];
    ++sum[a + x + 1][b + x + 2];
    --sum[a + x + 2][b + x + 2];
    ++sum[a + x + 2][b + 1];
    --sum[a + x + 1][b];
  }

  for(int i = 1; i <= N + 10; i++){
    for(int j = 1; j <= i + 5; j++){
      sum[i][j] += sum[i - 1][j - 1];
    }
  }
  for(int i = 1 ; i <= N + 10 ; i++){
    for(int j = 1 ; j <= i + 5; j++){
      sum[i][j] += sum[i][j - 1];
    }
  }
  for(int i = 1; i <= N + 10; i++){
    for(int j = 1; j <= i + 5; j++){
      sum[i][j] += sum[i - 1][j];
    }
  }

  int ret = 0, cnt = 0;
  for(int i = 1; i <= N; i++){
    for(int j = 1; j <= i; j++){
      if(sum[i][j]) ret++;
    }
  }
  cout << ret << endl;
}