Go: package main

import (
	"bufio"
	"fmt"
	"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 max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func main() {
	scanner.Split(bufio.ScanWords)
	a := make([]int, 8)
	for i := 0; i < 8; i++ {
		a[i] = nextInt()
	}
	s := 0
	for i := 0; i < 4; i++ {
		s += a[i]
	}
	t := 0
	for i := 4; i < 8; i++ {
		t += a[i]
	}
	fmt.Println(max(s, t))
}

C++: #include<stdio.h>
int main(void)
{
	int x1,x2,x3,x4,y1,y2,y3,y4,s,t;
	scanf("%d %d %d %d %d %d %d %d",&x1,&x2,&x3,&x4,&y1,&y2,&y3,&y4);
	s=x1+x2+x3+x4;
	t=y1+y2+y3+y4;
	if(s>t){
		printf("d\n",s);
	}
	else if(s==t){
		printf("%d\n",t);
	}
	else if(s<t){
		printf("%d\n",t);
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){

	int a,b,c,d,e,f,g,h,s,t;
	cin >> a >> b >> c >> d >> e >> f >> g >> h;
	s = a+b+c+d;
	t = e+f+g+h;

	if(s >= t){
		cout << s << endl;
	}
	else{
		cout << t << endl;
	}

	return 0;
}

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

using namespace std;

int main() {
	int a, b, c, d;
	c = d = 0;
	for (int i = 0; i < 4; i++) {
		cin >> a;
		c += a;
	}
	for (int i = 0; i < 4; i++) {
		cin >> a;
		d += a;
	}
	cout << max(c, d) << endl;
	return 0;
}

C++: #include<cstdio>
using namespace std;
int main(void){
    int sum1 = 0,sum2 = 0;
    int a;
    for(int i = 0;i < 4;i++){
        scanf("%d",&a);
        sum1 += a;
    }
    for(int i = 0;i < 4;i++){
        scanf("%d",&a);
        sum2 += a;
    }
    if(sum1 >= sum2) printf("%d\n",sum1);
    else printf("%d\n",sum2);
    return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int x, y, z, w, u;
    int a, b, c, d, e;
    cin >> x >> y >> z >> w;
    u = x + y + z + w;
    cin >> a >> b >> c >> d;
    e = a + b + c + d;
    if(u > e){
        cout << u << endl;
    }
    else{
        cout << e << endl;
    }
}

C++: #include<stdio.h>
int main(void)
{
	int a1,a2,a3,a4,s;
	int b1,b2,b3,b4,z;
	scanf("%d %d %d %d",&a1,&a2,&a3,&a4);
	s=a1+a2+a3+a4;
	scanf("%d %d %d %d",&b1,&b2,&b3,&b4);
	z=b1+b2+b3+b4;
	if(s>=z){
		printf("%d\n",s);
	}
	else if(z>s){
		printf("%d\n",z);
	}
	return 0;
}

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

int main {     
int S=0,T=0,a,b,i;
     for(i=0;i<4;i++) {
         cin >> a;
         S += a;
     }
     for(i=0;i<4;i++) {
         cin >> b;
         T += b;
     }
     cout << S>T?S:T;
}

C++: #include<stdio.h>
int main(void)
{
	int n=0,m=0,x=0,w=0,n2=0,m2=0,x2=0,w2=0,s=0,t=0;
	scanf("%d %d %d %d",&n,&m,&x,&w);
		s=n+m+x+w;
	scanf("%d %d %d %d",&n2,&m2,&x2,&w2);		
		t+=m2+n2+x2+w2;
	if(s>t&&s==t){
		printf("%d\n",s);
	}	
	else{
		printf("%d\n",t);
	}
}

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

int main() {
	int ajou, asu, ari, aei, S ;/*A???????????????*/
	int bjou, bsu, bri, bei, T ;/*B???????????????*/
	scanf("%d%d%d%d", &ajou, &asu, &ari, &aei);
	scanf("%d%d%d%d", &bjou, &bsu, &bri, &bei);
	S = ajou + asu + ari + aei ;
	T = bjou + bsu + bri + bei ;
	if(S>T)
	{
		printf("%d",S);
	}else if(S<T){
		printf("%d",T);
	}else{
		printf("%d",S);
	}
	
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>

using namespace std;

int main (void){

	int sumA = 0;
	int sumB = 0;
	int fake = 0;

	for(int i=0;i<4;i++){
		scanf("%d",&fake);
		sumA += fake;
	}
	for(int i=0;i<4;i++){
		scanf("%d",&fake);
		sumB += fake;
	}

	printf("%d\n",max(sumA,sumB));

	return 0;
}

C++: #include <iostream>

using namespace std;

int main(){

	int s1[5] , s2[5];
	int ans1 = 0 , ans2 = 0;

	for(int i = 0; i < 4; i++){
		cin >> s1[i];

		ans1 += s1[i];
	}

	for(int i = 0; i < 4; i++){
		cin >> s2[i];

		ans2 += s2[i];
	}

	if(ans1 < ans2) cout << ans2 << endl;
	else if(ans1 > ans2) cout << ans1 << endl;
	else if(ans1 == ans2) cout << "S(=T)" << endl;

	return 0;
}

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

#define A 0
#define B 1

int main(){
    int info[2], math[2], science[2], english[2];

    cin >> info[A] >> math[A] >> science[A] >> english[A];
    cin >> info[B] >> math[B] >> science[B] >> english[B];

    cout << max(info[A]+math[A]+science[A]+english[A], info[B]+math[B]+science[B]+english[B]) << endl;
}

C++: #include<stdio.h>
int main(void)
{
	int a,b,i,j,s,ss;
	for(i=0;i<4;i++){
		scanf("%d",&a);
		s+=a;
	}
	for(j=0;j<4;j++){
		scanf("%d",&b);
		ss+=b;
	}
	if(s>=ss){
		printf("%d\n",s);
	}
	else if(s<ss){
		printf("%d\n",ss);
	}
	return 0;
}

C++: #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <math.h>
#include <cstdio>
#include <float.h>
#include <ctype.h>
using namespace std;
int main(void) {
	int joha,johb,mata,matb,scia,scib,enga,engb,totala,totalb;
	scanf("%d %d %d %d", &joha, &mata, &scia, &enga);
	scanf("%d %d %d %d", &johb, &matb, &scib, &engb);
	totala = joha + mata + scia + enga;
	totalb = johb + matb + scib + engb;
	if (totala >= totalb) {
		printf("%d\n", totala);
	}
	else {
		printf("%d\n", totalb);
	}
	
	return 0;
}

C++: #include<iostream>

int main(){
	int sum[2],a;
	sum[0]=0;
	sum[1]=0;
	for(int i=0;i<2;++i){
		for(int i=0;i<4;++i){
			std::cin>>a;
			sum[i]+=a;
		}
	}
	if(sum[0]<sum[1])
		std::cout<<sum[0]<<std::endl;
	else std::cout<<sum[1]<<std::endl;

	return 0;
}

C++: #include <stdio.h>
#define N 4

int main(void){
    int tmp, sumA=0, sumB=0;
    
    for (int i=0; i<N; i++){
        scanf("%d", &tmp);
        sumA += tmp;
    }
    for (int i=0; i<N; i++){
        scanf("%d", &tmp);
        sumB += tmp;
    }
    printf("%d", sumA>sumB?sumA:sumB);
    return 0;
}

C++: #include <cstdio>
#define MAX(a,b)((a)>=(b)?(a):(b))
int main() {
	int S,T;
	int i,m,s,e;
	scanf("%d %d %d %d",&i,&m,&s,&e);
	S=i+m+s+e;
	scanf("%d %d %d %d",&i,&m,&s,&e);
	T=i+m+s+e;
	printf("%d\n",MAX(S,T));
}

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

using namespace std;

int main()
{
    int A,B,a,b,c,d,cnt = 0;

    scanf("%d%d%d%d",&a,&b,&c,&d);
    A = a + b + c + d;
    scanf("%d%d%d%d",&a,&b,&c,&d);
    B = a + b + c + d;
    if(A<B){
        printf("%d\n",B);
    }
    else printf("%d\n",A);

    return 0;
}

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

int main() {
	int a, b, c, d, e, f, g, h;
	cin >> a >> b >> c >> d >> e >> f >> g >> h;
	cout  << max(a + b + c + d, e + f + g + h) << endl;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cmath>

#define rep(i, n) for(int i = 0; i < n; i ++)
#define ALL(T) T.begin(), T.end()

using namespace std;

typedef pair<int, int> pii;
typedef unsigned long long ull;

const int S_N = 4;
const int P_N = 2;

int main(){
    int res;
    rep(i, P_N){
        int sum = 0;
        rep(j, S_N){
            int score; cin >> score;
            sum += score;
            res = max(res, sum);
        }
    }
    cout << res << endl;

    return 0;
}

C++: #include<iostream>
using std::cout;
using std::cin;
using std::endl;

int main(){
	int tmp,S=0,T=0;
	for(int i; i<4; i++){
		cin >> tmp;
		S+=tmp;
	}
	for(int i; i<4; i++){
		cin >> tmp;
		T+=tmp;
	}
	if(S>T)
		cout << S << endl;
	else
		cout << T << endl;
	return 0;
}

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

int main {
    int S=0,T=0,a,b,i;
     for(i=0;i<4;i++) {
         cin >> a;
         S += a;
     }
     for(i=0;i<4;i++) {
         cin >> b;
         T += b;
     }
     cout << S>T?S:T;
}