Go: package main

import "fmt"

func main() {
    var n int
    a := make([]float64, 10004)
    for {
        fmt.Scan(&n)
        if n == 0 { break }

        ave_num := 0.0
        for i := 0; i < n; i++ {
            fmt.Scan(&a[i])
            ave_num += a[i]
        }
        ave_num /= float64(n)
        cnt := 0
        for i := 0; i < n; i++ {
            if a[i] <= ave_num {
                cnt++
            }
        }
        fmt.Println(cnt)
    }
}

C++: #include <cstdio>

int a[(int)1e4 + 10];

int main() {
	int n;
	while (~scanf("%d", &n) && n) {
		int sum = 0;
		int average;
		for (int i = 0; i < n; i++) 
			scanf("%d", &a[i]), sum += a[i];
		average = sum / n;
		int ans = 0;
		for (int i = 0; i < n; i++) {
			if (a[i] <= average) ans++;
		}
		printf("%d\n", ans);
	}
	return 0;
}

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

using namespace std;

int main(){
    int people,money,ave,count;
    vector<int> syotoku;
    vector<int> res;

    while(1){
        cin>>people;
        if(people == 0) break;

        ave = 0;
        syotoku.clear();
        count = 0;
        for(int i=0;i<people;i++){
            cin>>money;
            ave+=money;
            syotoku.push_back(money);
        }

        ave/=people;
        for(int i=0;i<people;i++){
            if(syotoku[i]<=ave) count++;
        }

        res.push_back(count);
    }

    for(int i=0;i!=res.size();i++){
        cout<<res[i]<<endl;
    }
    return 0;
}

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

int main(){

    while(1){

        long long n; cin >> n;
        if(!n) break;
        vector<long long> a(n);
        long long sum = 0LL;
        for(int i = 0; i < n; i++){
            cin >> a[i];
            sum += a[i];
        }

        long long ans = 0LL;
        for(int i = 0; i < n; i++){

            if(sum >= a[i] * n) ans++;
        }

        cout << ans << endl;
    }

    return 0;
}

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


int main(){
    ios::sync_with_stdio(false);
	cin.tie(0);

    int n;
    while(cin>>n){
        if(n==0) break;
        int a[n];
        double sum=0;
        for(int i=0;i<n;i++){
            cin>>a[i];
            sum+=a[i];
        }
        sum/=n;
        int ans=0;
        for(int i=0;i<n;i++){
            if(sum>=a[i]) ans++;
        }
        cout<<ans<<endl;


    }
    
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<utility>
#include<set>
using namespace std;
using ll = long long;

int main(){
    while(1){
        ll n,sum=0,cnt=0;
        cin >> n;
        if(n==0)    break;
        vector<ll> a(n);
        for(ll i=0;i<n;i++){
                cin >> a[i];
                sum+=a[i];
        }
        sum/=n;
        for(ll i=0;i<n;i++){
            if(a[i]<=sum)   cnt++;
        }
        cout << cnt << endl;
    }
}

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

int main(void){
    int n;
    while(cin>>n,n){
        double s=0;
        int a[n];
        int ans=0;
        for(int i=0;i<n;i++) cin>>a[i],s+=a[i];
        s/=n;
        for(int i=0;i<n;i++){
            if(a[i]<=s) ans++;
        }
        cout<<ans<<endl;
    }
    return 0;
}

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

int main(){
    while(1){
    int n;
    cin >> n;
    if(n==0) break;
    vector<int> vec(n,0);
    for(int i=0;i<n;i++){
        cin >> vec.at(i);
    }
    int ave=0;
    for(int i=0;i<n;i++){
        ave +=vec.at(i);
    }
    ave=ave/n;
    int count=0;
    for(int i=0;i<n;i++){
        if(vec.at(i)<=ave) count++;
    }
    cout << count << endl;
    }
}

C++: #include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,ll> P;
typedef pair<ll,P> PP;
const ll MOD = 1e9+7;

int main(){
  ll n;
  while(cin>>n,n){
  ll sum=0;
  ll a[11111];
  for(int i=0;i<n;i++){
	cin>>a[i];
	sum+=a[i];
  }
  ll cnt=0;
  for(int i=0;i<n;i++){
	if(a[i]<=sum/n)cnt++;
  }
  cout<<cnt<<endl;
  }
  return 0;
}

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

void solve(int n){
	int a[n] = {};
	int s = 0;
	for(int i=0; i<n; ++i){
		cin >> a[i];
		s += a[i];
	}
	int ans = 0;
	for(int i=0; i<n; ++i)
		if(a[i] * n <= s)
			++ans;
	cout << ans << "\n";
}

int main(){
//	cin.tie(0);
//	ios::sync_with_stdio(false);
	while(1){
		int n;
		cin >> n;
		if(n == 0) return 0;
		solve(n);
	}
}

C++: 
//---------------------------------------------------------------------------------------------------
void _main() {
	while (cin >> N) {
		if (N == 0) return;
		rep(i, 0, N) cin >> A[i];

		int sm = 0;
		rep(i, 0, N) sm += A[i];

		int ans = 0;
		rep(i, 0, N) if (A[i] * N <= sm) ans++;
		printf("%d\n", ans);
	}
}

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


int main(){
        int a[10000];
        int i,avg,n,sum,count;

        while(1) {
                sum=0;
                count=0;

                cin>>n;

                if(n==0) {
                        break;
                }

                for(i=0; i<n; i++) {
                        cin>>a[i];
                        sum += a[i];
                }

                avg=sum/n;

                for(i=0; i<n; i++) {
                        if(avg>=a[i]) {
                                count++;
                        }
                }

                cout<<count<<endl;
        }
}

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

using i64 = int64_t;

int main(){
    int n;
    while(cin >> n, n != 0){
        vector<i64> v;
        i64 sum = 0;
        for(int i=0;i<n;++i){
            i64 tmp;
            cin >> tmp;
            v.push_back(tmp);
            sum += tmp;
        }
        double mean = sum / (double)n;
        int ans = 0;
        for(int i=0;i<n;++i){
            if(v[i] <= mean)ans++;
        }

        cout << ans << endl;
    }

    return 0;
}

C++: #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define INF 100000000
#define rep(i,s,n) for (int i = (int)(s); i < (int)(n); i++)
ll mod = 1000000007;
ll mod2 = 998244353;

int main(){
    vector<int> ans;
    while (true){
        int n;cin>>n;
        if (n==0) break;
        vector<int> a(n);
        ld sum = 0;
        rep(i,0,n){
            cin>>a[i];
            sum+=a[i];
        } 
        ld ave = sum/n;
        int num = 0;
        rep(i,0,n){
            if (a[i]<=ave) num+=1;
        }
        ans.push_back(num);
    }
    for(int an:ans){
        cout<<an<<endl;
    }
}

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

int main(){
  while(1){
    int n;
    cin >> n;
    if(n==0) break;
    int a[n];
    int sum=0;
    for(int i=0; i<n; i++){
      cin >> a[i];
      sum += a[i];
    }
    int c=0;
    for(int i=0; i<n; i++){
      if(sum/n>=a[i])
      c++;
    }
    cout << c << endl;
  }
  return 0;
}

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

  int array[100005];
  cin>>n;
  while(n!=0){
    int sum=0;
    int cnt=0;
    for(int i=0;i<n;i++){
      cin>>array[i];
      sum+=array[i];
    }
    
    for(int i=0;i<n;i++){
      if(array[i]*n<=sum){
	cnt++;
      }
    }
    cout<<cnt<<endl;
    cin>>n;
  }
  return(0);
}

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

int D[10005];

int main(){
    int n,avg,x,ans;
    while(1){
        avg=ans=0;
        cin>>n;
        if(!n) break;
        for(int i=0;i<n;i++){
            cin>>x;
            D[i]=x;
            avg+=x;
        }
        avg/=n;
        for(int i=0;i<n;i++) if(D[i]<=avg) ans++;
        cout<<ans<<endl;
    }
    return 0;
}