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++: 
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>

using namespace std;

int main()
{
	int N,average=0,count=0;
	int a[10000];

	start:

	scanf("%d", &N);

	if (N == 0) {
		goto finish;
	}

	for (int i = 0; i < N; i++) {
		cin >> a[i];
		//scanf("%d", &a[i]);
	}

	for (int i = 0; i < N; i++) {
		average += a[i];
	}

	average /= N;

	for (int i = 0; i < N; i++) {
		if (a[i] <= average) {
			count++;
		}
	}

	cout << count<<endl;

	average = 0;
	count = 0;

	goto start;

	finish:

	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define dump(x) cout << (x) << '\n';
typedef int64_t Int;
Int mod = 1e9+7;
Int INF = 1e9+7;

int main() {
    ios::sync_with_stdio(false);
    while (true) {
        double n;
        cin >> n;
        vector<double> a(n);
        if (n == 0) break;
        double x = 0.0;
        for (Int i = 0; i < n; i++) {
            cin >> a[i];
            x += a[i];
        }
        Int av = x / n;
        sort(a.begin(), a.end());
        Int res = 0;
        for (Int i = 0; i < (Int)n && a[i] <= av; i++) res++;
        dump(res);
    }
    return 0;
}

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, a[n], ans, mean;

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

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int (i)=(0);(i)<(int)(n);++(i))
using ll = long long;
using P = pair<ll, ll>;
using namespace std;

template<class T> void vin(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
}

int main() {
    int n;
    while (cin >> n, n) {
        vector<double> a(n);
        double ave = 0;
        rep(i, n) {
            cin >> a[i];
            ave += a[i];
        }
        ave /= n;
        int ans = 0;
        rep(i, n) {
            if (ave >= a[i]) ans++;
        }
        cout << ans << endl;
    }
}

C++: #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T> V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> > Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T> mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }

/*
 <url:>
 問題文============================================================
 =================================================================
 解説=============================================================
 ================================================================
 */

template<class Type>
Type solve(Type res = Type()){
    int n;
    while(cin >> n){
        if(n == 0) break;
        vector<double> a(n); for(auto& in:a) cin >> in;
        double ave = accumulate(a.begin(),a.end(),0.0)/n;
        sort(a.begin(),a.end());
        cout << (int)(upper_bound(a.begin(),a.end(),ave)-a.begin()) << endl;
    }
    
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    solve<ll>();
    //cout << fixed << setprecision(15) << solve<ll>() << endl;
    return 0;
}

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

int main() {
    int n;
    while(cin >> n, n) {
        vector<int> a(n);
        int sum = 0;
        for(int i = 0; i < n; ++i) {
            cin >> a[i];
            sum += a[i];
        }
        int ans = 0;
        for(int i = 0; i < n; ++i) {
            ans += a[i] * n <= sum;
        }
        cout << ans << endl;
    }
}

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

int main() {
	int n;
	while (cin >> n, n) {
		vector<double> a(n);
		double sum = 0;
		for (double& i : a) {
			cin >> i;
			sum += i;
		}
		int ans = 0;
		for (double& i : a) {
			if (i <= sum / n) ++ans;
		}
		cout << ans << endl;
	}
}

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


int main()
{
	double a[10000];
	while(1)
	{
		int n;
		double ave=0.0f;
		cin>>n;
		if(n==0)
			break;

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

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




int main(){
	while(true){
	double a[100005] = {0}, ave = 0, sum = 0;
	int ans = 0, n = 0;
	cin >> n;
	if(n == 0) return 0;
	ans = 0;
	for(int i = 0; i < n; i++){
		cin >> a[i];
		sum += a[i];
	}
	sum /= n;
	//cout<<sum<<endl;
	for(int i = 0; i < n; i++){
		if(a[i] <= sum) ans++;
	}
	printf("%d\n", ans);
}
	return 0;
}

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

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

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

int main() {
	while (true) {
	int n;
	std::cin >> n;
	if (n == 0) break;
	std::vector<int> a(n);
	int sum = 0;
	for(auto& v : a) {
		std::cin>>v;
		sum += v;
	}

	int ans = 0;
	for(auto v : a) {
		if (v * n <= sum) ++ans;
	}

	std::cout << ans << std::endl;
}
	return 0;

}

C++: 
#include<bits/stdc++.h>
using namespace std;
#define inf 1000000000
#define INF 1000000000000000
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define PLL pair<ll,ll>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
#define IN(a,n) rep(i,n){ cin>>a[i]; }
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define PI 3.14159265
#define F first
#define S second
#define PB push_back
#define EB emplace_back
void init(){
  cin.tie(0);
  ios::sync_with_stdio(false);
}

int n;
int sum=0;
int a[110000];

int main(){
  while(true){
    sum=0;
    cin>>n;
    if(n==0) break;
    rep(i,n){
      cin>>a[i];
      sum+=a[i];
    }
    sum/=n;

    int asn=0;
    rep(i,n){
      if(sum>=a[i])
        asn++;
    }

    cout<<asn<<endl;
  }
}