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 <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main(){
	string s1, s2;
	int n, n1[100], n2[100];cin >> n;
	for(int g = 0;g < n;g++){
		int f = 0;
		cin >> s1 >> s2;
		for(int i = 0;i < 100;i++)n1[i] = n2[i] = 0;
		if(s1.size()>80 || s2.size()>80)f = 1;
		if(!f){
		for(int i = 0;i < s1.size();i++)n1[i] = s1[s1.size()-i-1] - '0';
		for(int i = 0;i < s2.size();i++)n2[i] = s2[s2.size()-i-1] - '0';
		
		for(int i = 0;i < 90;i++){
			n1[i] += n2[i];
			if(n1[i] > 9){n1[i] = n1[i]%10;n1[i+1]++;}
		}
		int flag = 0;
		for(int i = 90;i >= 0;i--){
			if(flag && i >= 80){f = 1;break;}
			if(flag)cout << n1[i];
			if(!flag && i > 0 && n1[i-1] != 0)flag = 1;
		}
		if(!f)cout << endl;
		}
		if(f)cout << "overflow" << endl;
	}
	return 0; 
}