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 <bits/stdc++.h>
using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;
using pll = pair<ll,ll> ;

const int mod = 1000000007;
constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll a,ans = 0;
  rep(i,5){
    cin >> a;
    a = (a < 40)? 40 : a;
    ans += a;
  }
  cout << ans / 5<<endl;
  return 0;
}

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

C++: #include<stdio.h>
int main(void)
{
	int a,b,c,d,e,max,ans;
	scanf("%d %d %d %d %d",&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;
	}
	max=a+b+c+d+e;
	ans=max/5;
	printf("%d\n",ans);
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <bitset>
#include <cmath>
#include <string>
#define FI first
#define SE second
#define PF push_front
#define PB push_back
#define POF pop_front
#define POB pop_back
#define MA make_pair
#define ll long long
#define VE vector<int>
#define VP vector<pair<int,int> >
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
using namespace std;
//
const int INF=1e9+7;
const int mod=1e9+7;
//
int main(){
  int A,B,C,D,E;
  cin>>A>>B>>C>>D>>E;
  cout<<(max(A,40)+max(B,40)+max(C,40)+max(D,40)+max(E,40))/5<<endl;
  return 0;
}

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

int main(){
int t[10],al=0;
for(int i=0;i<5;i++){
cin>>t[i];
if(t[i]<40){t[i]=40;}
al+=t[i];
}
cout<<al/5<<endl;

return 0;
}

C++: #include<stdio.h>

int main(){
int s=0,x;
for(inti=0;i<5;i++)
{scanf("%d",&x);if(x<40)x=40;s+=x;}

printf("%d\n",x/5);
return 0;
}

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

int a,sum=0;
int main(){
int i;
for( i = 0; i < 5; i++ ){
cin >> a;
sum += a + min(a-40,0);
}
cout << sum/5 << endl;
return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<30
#define pb push_back
#define mp make_pair

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int main() {
	int n = 5;
	vector<int> v(n);
	rep(i, n) cin >> v[i];

	int sum = 0;
	rep(i, n) {
		if(v[i] < 40) v[i] = 40;
		sum += v[i];
	}

	cout << sum / 5 << endl;

	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<functional>
#include<climits>
#include<stack>
#include<queue>
#include<cmath>
#define int long long
#define INF 100000000000
#define EPS 0.0000000001

using namespace std;

signed main() {
	int sc[6] = { 0 };
	int ans = 0;
	for (int i = 0; i < 5; i++) {
		cin >> sc[i];
		if (sc[i] <= 40)sc[i] = 40;
		ans += sc[i];
	}
	cout << ans/5 << endl;
	return 0;
}

C++: #include <iostream>

using namespace std;

#define MAX(a,b) ((a)>(b)?(a):(b))

int main()
{
    int total=0;
    int p;

    for(int i=0; i<5; ++i) {
        cin >> p;
        total+=MAX(p,40);
    }
    cout << total/5 << endl;
    return 0;
}

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

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define ALL(v) (v).begin(), (v).end()
#define LENGTHOF(x) (sizeof(x) / sizeof(*(x)))
#define AFILL(a, b) fill((int*)a, (int*)(a + LENGTHOF(a)), b)
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define INF 1 << 30
#define EPS 1e-10

typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;

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

C++: #include<iostream>
using namespace std;
int main(){
int sum=0,ten[5];
for(int i=0;i<5;i++){
cin>>ten[i];
if(ten[i]<40)ten[i]=40;

sum+=ten[i];
}
cout<<sum/5<<endl;

return 0;
}

C++: #include <stdio.h>

int main(){
  int i, sum = 0,a;
  for(i = 0 ; i < 5 ; i++){
    scanf("%d",&a);
    sum += a;
  }
  printf("%d\n",sum/5);
  return 0;
}

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

int n, a;

int main()
{

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

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

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main(){
  int sum=0,a;
  for(int i=0;i<5;i++){
    cin >> a;
    if(a<40){
      a=40;
    }
    sum+=a;
  }
  cout << sum/5 << endl;
  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;
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=998244353,MAX=1<<18,INF=1<<30;

int main(){
vector<int> A(5);
int ans=0;
for(int i=0;i<5;i++){
cin>>A[i];
A[i]=max(A[i],40);
ans+=A[i];
}
cout<<ans/5<<endl;

}

C++: #include<iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cmath>
#include <set>
#include <string.h>
#include <functional>

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<<(s+b+c+d+e)/5<<endl;
    return 0;
}