Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	n, _ := strconv.Atoi(sc.Text())
	return n
}

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

	sum := 0
	for i := 0; i < 5; i++ {
		x := nextInt()
		if x < 40 {
			sum += 40
		} else {
			sum += x
		}
	}
	fmt.Println(sum / 5)
}

C++: #include <iostream>
#include <algorithm>
#include <climits>
#include <string>
#include <vector>
#include <cmath>

using namespace std;

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


int main() {
  int A, B, C, D, E, F;
  cin >> A >> B >> C >> D >> E >> F;
  int s = A + B + C + D;
  s -= min(min(A, B), min(C, D));
  cout << s + max(E, F) << "\n";
  return 0;
}

C++: #include<iostream>
using namespace std;
int main(int i){
int s[2]={0};
for(;i<6;i++){cin >> s[0];
s[1] += s[0]>39?s[0]:40;
}
cout << s[1]/5 << endl;
return 0;
}

C++: #include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i,a,b) for(int i = (a); i < (b); i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int main(){
	int sum = 0;
	rep(i, 5){
		int x;
		scanf("%d",&x);
		if(x<=40){
			x =40;
		}
		sum +=x;
	}
	printf("%d",sum/5);
	return 0;
}

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

int main(){
  int a,s,d,f,g;
  cin>>a>>s>>d>>f>>g;

  if(a<40) a=40;
  if(s<40) s=40;
  if(d<40) d=40;
  if(f<40) f=40;
  if(g<40) g=40;

  cout << (a+s+d+f+g)/5 << endl;

  
    
  return 0;
}

C++: #include<stdio.h>
int main(){
    int ans=0;
    for(int i=0;i<5;i++){
        int a;
        scanf("%d",&a);
        if(a<40) ans+=40;
        else ans+=a;
    }
    printf("%d\n",ans/5);
    return 0;
}

C++: #include<stdio.h>
#include<iostream>
using namespace std;
int main()
{
	int a,g=0;
	int n;
	for(int i=0;i<5;i++){
		cin>>a;
		if(a<40)g+=40;
		else g+=a;
	}
	cout<<g/5;
	

	
}

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

int main() {
	int a, score = 0;
	for (int i = 0; i < 5; i++) {
		cin >> a;
		if (a < 40) {
			a = 40;
		}
		score += a;
	}
	cout << score / 5 << endl;
}

C++: #include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(a) (a).begin(),(a).end()
#define MOD 10000
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
const ull B=100000007;
const int INF=1e9;
int main(){
      int ans=0,a;
      REP(i,5){
            cin>>a;
            ans+=a/5;
      }
      cout<<ans<<endl;
}

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

int main(){
	int a;
	int S;
	for(int i=0;i<5;i++){
		cin>>a;
		if(a<40){
			a=40;
		}			
		S+=a;		
	}
	S=S/5;	
	cout<<S<<endl;
}

C++: #include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(a) (a).begin(),(a).end()
#define MOD 10000
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
const ull B=100000007;
const int INF=1e9;
int main(){
      int ans=0,a;
      REP(i,5){
            cin>>a;
            if(a<40)a=40;
            ans+=a/5;
      }
      cout<<ans<<endl;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
int main(void)
{
	int a[5]={0};
	for(int i=0;i<5;i++)
	{
		scanf("%d",&a[i]);
		if(a[i]<40){
			a[i]=40;
		}
	}
	printf("%d\n",(a[0]+a[1]+a[2]+a[3]+a[4])/5);
	return 0;
}

C++: #include <stdio.h>
int main(){
  int a,sum=0;
  for(int i=1;i<=5;i++){
    scanf("%d",&a);
    if(a>=40) {sum=sum+a;}
    else sum=sum+40;
  }
  printf("%d\n",sum/5);
  return 0;
}

C++: #include <iostream>
#include <stdio.h>
using namespace std;
int average(int a,int b,int c,int d,int e){
	return (a+b+c+d+e)/5;
}
int main() {
	int i=0;
	int stu[5];
	int heikin;
	while(i<5){
		scanf("%d", &stu[i]);
		stu[i] = max(40, stu[i]);
		i++;
	}
	heikin = average(stu[0], stu[1], stu[2], stu[3], stu[4]);
	printf("%d", heikin);
	return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <string.h>
#include <functional>
#include <algorithm>
#include <string>
#include <vector>
#include <algorithm>
#include <time.h>
#include <stdlib.h>

using namespace std;

int main (void)
{
	int a[5],con;

	for (int i = 0; i < 5; i++)
	{
		cin >> a[i];
		if (a[i] < 40)
		{
			a[i] = 0;
			a[i] = 40;
		}
		else
		{
		}
		con += a[i];
	}

	cout << con / 5 << endl;
return 0;
}

C++: #include <stdio.h>
#include <algorithm>
#include <stdlib.h>
#include <string.h>
#include <queue>
#define rep(i,n) for(int i = 0; i < n; ++i)
#define rrep(i,n) for(int i = 1; i <= n; ++i)
using namespace std;
typedef pair<int,int> P;
const int INF = 1000000000;



int main(){
	int a,b=0;
	rep(i,5){
	scanf("%d",&a);
	b+=(a>=40?a:40);
}
	printf("%d\n",b/5);
	
	return 0;
}

C++: #include <iostream>

using namespace std;

void solve()
{
	int score[5];
	int sum = 0;
	for(int i = 0; i < 5; ++i)
	{
		cin >> score[i];
		if(score[i] >= 40)
		{
			sum += score[i];
		}
		else
		{
			sum += 40;
		}
	}
	cout << sum / 5 << endl;
}

int main()
{
	solve();
	return(0);
}

C++: #include <iostream>
using namespace std;
int main()
{
	int a,b,c,d,e;
	cin >> a;if(a<40)a=40;
	cin >> b;if(b<40)b=40;
	cin >> c;if(c<40)c=40;
	cin >> d;if(d<40)d=40;
	cin >> e;if(e<40)e=40;
	int sum=a+b+c+d+e;
	cout << sum/5 << endl;
	return 0;
}

C++: #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <list>
#include <map>
#include <string>
#include <functional>
#include <math.h>
#include <utility>
using namespace std;
int main()
{
	int sum=0;
	for(int i=0;i<5;i++){
		int tmp;cin>>tmp;
		sum+=max(40,tmp);
	}
	cout<<sum/5<<endl;
}

C++: #include <iostream>

using namespace std;

int main()
{
    int n;
    int ans = 0;

    for (int i = 0; i < 5; i++) {
        cin >> n;
        n < 40 ? ans += 40 : ans += n;
    }

    cout << ans / 5 << endl;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int a,b,c,d,e;
	cin>>a>>b>>c>>d>>e;
	if(a<40)a=40;
	if(b<40)b=40;
	if(c<40)c=40;
	if(d<40)d=40;
	if(e<40)e=40;
	cout<<(a+b+c+d+e)/5<<endl;
	return 0;
	}

C++: #include<stdio.h>
int main()
{
int kimatsu[5], goukei = 0,a,i;
	for (i = 0; i < 5; i++)
	{
		scanf("%d", &kimatsu[i]);
		for (a = 40; kimatsu[i] < a;)
		{
			kimatsu[i] = 40;
		}
	}
	goukei =( kimatsu[0] + kimatsu[1] + kimatsu[2] + kimatsu[3] + kimatsu[4])/5;
	printf("%d",goukei);

	return 0;
}

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

int main(){
  int stu[5];
  int ava;
  for(int i=0;i<5;i++){
    cin >> stu[i];
    if(stu[i] < 40){
      stu[i] = 40;
    }
    ava += stu[i];
  }
  ava = ava / 5;
  cout << ava << endl;
}

C++: #include <iostream>

using namespace std;

int main(void){

  int score, sum = 0;
  for(int i = 0; i < 5; i++){
    cin >> score;
    if(score < 40)	score = 40;
    sum += score;
  }
  cout << sum/5;

  return 0;
}

C++: #include <cstdio>

int main(){
	int ave = 0;
	for(int i = 0; i < 5; i++){
		int p; scanf("%d", &p);
		if(p < 40) p = 40;
		ave += p;
	}
	printf("%d\n", ave/5);
}