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<iostream>
using namespace std;
int main(){
int aa,ab,ac,ad,ba,bb,bc,bd,sum_a,sum_b;

cin>>aa>ab>>ac>>ad;
cin>>ba>>bb>bc>>bd;
sum_a=aa+ab+ac+ad;
sum_b=ba+bb+bc+bd;

if(sum_a>=sum_b){
cout<<sum_a<<endl;
}else{
cout<<sum_b<<endl;
}

return 0;
}

C++: #include<iostream>
using namespace std;
int suma, sumb;
signed main(){
  for(int i = 0; i < 4; i++){
    int temp;
    cin >> temp;
    suma += temp;
  }
  for(int i = 0; i < 4; i++){
    int temp;
    cin >> temp;
    sumb += temp;
  }
  cout << max(suma , sumb) << endl;
  return 0;
}

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

int main() {
	int a1,a2,a3,a4,b1,b2,b3,b4,asum = 0,bsum = 0;
	cin >> a1 >> a2 >> a3 >> a4;
	cin >> b1 >> b2 >> b3 >> b4;

	asum = a1 + a2 + a3 + a4;
	bsum = b1 + b2 + b3 + b4;
	if(asum > bsum){
		cout << asum << endl;
	}
	else{
		cout << bsum << endl;
	}
	return 0;
}

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

int main()
{
	int s,t,sp=0,tp=0;
	for(int i=0;i<4;i++){
		cin >> s;
		sp += s;
	}
	for(int i=0;i<4;i++){
		cin >> t;
		tp += t;
	}
	cout << max(sp,tp) << endl;
	return 0;
}

C++: #include <iostream>
#include <set>
#include <vector>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)

int main(){
	int d[2]={0},t;
	rep(i,2) rep(j,4)cin >> t , d[i] += t;
	cout << max(d[0],d[1]) << endl;
}

C++: #include<iostream>
using namespace std;
int main(){
int a=0,b=0,tmp;
for(int i=0;i<4;i++){
cin >> tmp; a+=tmp;
}
for(int i=0;i<4;i++){
cin >> tmp; b+=tmp;
}
cout << std::max(a,b) << endl;
}

C++: #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPLL(i, n) for (ll i = 0; i < (ll)(n); i++)
using namespace std;
template<class T>inline bool chmax(T &a, const T &b){if(a < b){a = b; return 1;}return 0;}
template<class T>inline bool chmin(T &a, const T &b){if(a > b){a = b; return 1;}return 0;}
typedef long long ll;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int S = 0, T = 0;
  REP(i, 4){
    int a; cin >> a;
    S += a;  
  }
  REP(i, 4){
    int b; cin >> b;
    T += b;
  }
  if(S >= T){
    cout << S << endl;
  }else{
    cout << T << endl;
  }
}

C++: #include <iostream>
using namespace std;
int k;
int t;
int i;
int n;
int o;
int r;
int e;
int g;
int usi;
int main(){
  cin>>k>>t>>i>>n;
  cin>>o>>r>>e>>g;
  if(k+t+i+n>o+r+e+g){
    cout<<k+t+i+n;}
  else{
    cout<<o+r+e+g;}
  return 0;
}

C++: ////////////////////////////
//情報オリンピック過去問////
//Score				 ////
//AOJ 0510			  ////
////////////////////////////

/*
 *設問解説
 *情報・数学・理科・英語のAさんBさんの合計得点
 *のうち大きい方を出力
 *同点の場合は、どちらか片方を出力
*/

#include<stdio.h>
int main(){
	int aa,ab,ac,ad;
	int ba,bb,bc,bd;
	int asum,bsum,abmax;

	scanf("%d %d %d %d",&aa,&ab,&ac,&ad);
	scanf("%d %d %d %d",&ba,&bb,&bc,&bd);

	asum=aa+ab+ac+ad; bsum=ba+bb+bc+bd;	

	if(asum >= bsum){
		abmax=asum;
	}else{
		abmax=bsum;
	}
	
	printf("%d",abmax);

	return 0;

}

//end

/////////////////////////////////////////////
//解き方								   //
//	intで四科目おく					  //
//	intでaとbの得点を置く				//
//	intで最高点を置く					//
//	ifでabの大小を考えて				 //
//	最高点に代入						 //
//	最高点をprintfで出力				 //
//	簡単！							   //
/////////////////////////////////////////////

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
  int sum[2] = { 0 };
  int point;

  for(int i = 0;i < 2;i++){
    for(int j = 0;j < 4;j++){
      cin >> point;
      sum[i] += point;
    }
  }
  if(sum[0] > sum[1])cout << sum[0] << endl;
  if(sum[0] < sum[1])cout << sum[1] << endl;
  else cout << sum[0] << endl;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <utility>
#include <iomanip>
#include <functional>
#include <queue>
#include <stack>
#include <map>
#include <vector>
#include <cmath>
#define ll long long
#define INF 10000000000000000
#define MOD 998244353
using namespace std;


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

C++: #include <bits/stdc++.h>
using namespace std;
// #define int long long
typedef long long ll;
typedef pair<int,int> pii;
#define ITR(v,c) for(auto v=begin(c);v!=end(c);v++)
#define FOR(v,a,n) for(int v=a;v<(int)(n);v++)
#define FORE(x,arr) for(auto &x:arr)
#define REP(v,n) FOR(v,0,n)
#define RREP(v,n) for(int v=(int)(n);v>=0;v--)
#define ALL(c) begin(c),end(c)
const int DX[4]={0,1,0,-1}, DY[4]={-1,0,1,0};
const int INF = 1e9;
const ll INFLL = 1e18;
template<class T,class U>ostream&operator<<(ostream &os,const pair<T,U> &p){
    os<<"("<<p.first<<","<<p.second<<")";return os;}
template<class T>ostream&operator<<(ostream &os,const vector<T> &v){
    ITR(i,v)os<<*i<<(i==end(v)-1?"":" ");return os;}
//------------------------------------------------------------------------------

signed main() {
    int s=0,t=0;
    REP(i,4) {
        int a;
        cin>>a;
        s+=a;
    }
    REP(i,4) {
        int a;
        cin>>a;
        t+=a;
    }
    cout<<max(t,s)<<endl;
    return 0;
}

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

int main()
{
    vector<int> sum_of_scores(2, 0);

    for (auto &s : sum_of_scores)
        for (int a, b, c, d; cin >> a >> b >> c >> d;)
            s = a + b + c + d;

    cout << max(sum_of_scores[0], sum_of_scores[1]) << endl;

    return 0;
}

C++: #include<bits/stdc++.h>

using namespace std;

main(){
	int a,b,c,d,A=0,B=0;
	cin >>a >>b >>c >>d;
	A=a+b+c+d;
	int e,f,g,h;
	cin >>e >>f >>g >>h;
	B=e+f+g+h;
	if (A>B){
	printf("%d\n",A);
	}
	else if (A<B){
	printf("%d\n",B);
	}
	else {
		printf("%d\n",A=B);
	}
}

C++: #include <iostream>
int main()
{
	int a[4],b[4];
	int A,B;
	A=B=0;
	for(int i=0; i<4; i++)std::cin>>a[i],A+=a[i];
	for(int i=0; i<4; i++)std::cin>>b[i],B+=b[i];
	printf("%d\n",A>B?A:B);
	return 0;
}

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

int main(){
  int Ainfo,Amath,Ascien,Aeng,Atotal;
  int Binfo,Bmath,Bscien,Beng,Btotal;
  cin>>Ainfo>>Amath>>Ascien>>Aeng;
  cin>>Binfo>>Bmath>>Bscien>>Beng;
  Atotal=Ainfo+Amath+Ascien+Aeng;
  Btotal=Binfo+Bmath+Bscien+Beng;
  if(Atotal>=Btotal){
    cout<<Atotal;
  }else{
    cout<<Btotal;
  }
  return 0;
}

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

int main(){
  
  int a, s1=0, s2=0;

  for(int i=0;i<8;i++){
    cin>>a;
    if(i<4) s1+=a;
    else s2+=a;
  }

  cout<<max(s1, s2)<<endl;
  
  
  return 0;
}

C++: #include <stdio.h>

int main(void) {
    int a1, a2, a3, a4, b1, b2, b3, b4, S, T;

    scanf ("%d %d %d %d\n", &a1, &a2, &a3, &a4);    
    scanf ("%d %d %d %d\n", &b1, &b2, &b3, &b4);

    S = a1 + a2 + a3 + a4;
    T = b1 + b2 + b3 + b4;

    if (S > T) {
        printf ("%d\n", S);
    }
    else {
        printf ("%d\n", T);
    }

    return 0;
}

C++: // Example program
#include <iostream>
#include <string>
#include<vector>
#include<algorithm>
using namespace std;


int main()
{
int a;
int b;
int c;
int d;
int e;
int f;
int g;
int h;

cin >> a;
cin >> b;
cin >> c;
cin >> d;
cin >> e;
cin >> f;
cin >> g;
cin >> h;

int s=(a+b+c+d);
int t=(e+f+g+h);

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