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<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }

int N, A[10101];
//---------------------------------------------------------------------------------------------------
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 <bits/stdc++.h>

using namespace std;

int main()
{
	int n;
	while (cin >> n, n)
	{
		vector<int> a(n);
		long long 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 (a[i] <= sum)
				ans++;
		}
		cout << ans << endl;
	}
}

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

int main(){
  int n;
  double ave = 0;
  double sum = 0;
  int ans = 0;

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

    int a[n];

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

    for(int i=0;i<n;i++){
      if(ave>=a[i]){
        ans++;
      }
    }

    cout << ans << endl;
    sum = 0;
    ans = 0;
  }

  return 0;
}

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

int main(){
  int n;
  int a[n];
  while(1){
  cin >> n;
  for(int i = 0; i< n; i++){
    cin >> a[i];
  }
  if(n == 0) break;
  
  int sum = 0;
  for(int i = 0; i < n; i++){
    sum += a[i];
   }
  double ave = 1.0 * sum / n;
  int count = 0;
  for(int i =0; i < n; i++){
   if(a[i] <= ave) count += 1;
  }

  cout << count << endl;
  }
return 0;
}

C++: #include <iostream>

int main(void)
{
    using namespace std;
    int Members, Scores[10000], Total = 0, Average, Poors = 0, i;

    while(true)
    {
        cin >> Members;
        for(i = 0; i < Members; i++)
        {
            Scores[i] = 0;
            cin >> Scores[i];
            Total = Total + Scores[i];
        }
        Average = Total / Members;
        for(i = 0; i < Members; i++)
        {
            if(Scores[i] <= Average)
            {
                Poors++;
            }
        }
        cout << Poors << "\n";
    }
}

C++: #include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin >>n;
    int a[10005];
    for(int i =0;i<n;i++)
    {
        cin >> a[i];
    }
    while(n>=2 &&n<=10000)
    {
       int sum=0,ave;
       for(int i = 0;i<n;i++)
        sum +=a[i];
       ave = sum/n;
       int count=0;
       for(int i =0;i<n;i++)
       {
           if(a[i]<=ave)
            count++;
       }
       cout <<count<<endl;




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



    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vb = vector<bool>;
using vs = vector<string>;
using msi = map<string, int>;
using mii = map<int, int>;
using psi = pair<string, int>;
using pii = pair<int, int>;
using tii = tuple<int, int>;
using vlai = valarray<int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define range(i,s,n) for(int i=s;i<n;i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define fs first
#define sc second
#define INF 1E9
#define LINF 1E18*5
#define EPS 1E-9
#define MOD 1000000007
#define PI 3.1415926535897932384

template<class S, class T>ostream& operator<<(ostream&os, pair<S, T>p) { os << "[" << p.first << ", " << p.second << "]"; return os; };
template<class S>auto&operator<<(ostream&os, vector<S>t) { bool a = 1; for (auto s : t) { os << (a ? "" : " ") << s; a = 0; } return os; }

//int dx[]={1,1,1,0,-1,-1,-1,0},dy[8]={1,0,-1,-1,-1,0,1,1,1};
//
constexpr ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }

class compare {
public:
	bool operator()(tuple<int, int> a, tuple<int, int> b) {
		return (get<1>(a) < get<1>(b));
	}
};

vl v(51);
vl p(51);
vl b(51);
ll ans = 0;

void rec(ll n, ll l) {
	if (n == 0)ans += 1;
	else if (l <= 1)return;
	else if (l >= (v[n] - 1) / 2){
		ans += p[n - 1];
		if (l >= (v[n] - 1) / 2 + 1)ans += 1;
		if (l - ((v[n] - 1) / 2 + 1) > 0) {
			rec(n - 1, l - ((v[n] - 1) / 2 + 1));
		}
	}
	else {
		rec(n - 1, l - 1);
	}
}

void solve(ll n) {
	vl v(n);
	ll sum = 0;
	rep(i, n) {
		cin >> v[i];
		sum += v[i];
	}
	ll ans = 0;
	rep(i, n) {
		if (v[i] * n <= sum)ans++ ;
	}
	cout << ans << endl;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll n;
	while (cin >> n,n) {
		solve(n);
	}
}

C++: //#include "pch.h"
#include <iostream>
#include<string>
#include<algorithm>
#include<iomanip>
#include<stdlib.h>
#include<vector>



using namespace std;


int main() {
	
	int num;
	cin >> num;
	while (num != 0) {
		vector<int> money(num);
		for (int i = 0; i < num; i++) {
			cin >> money[i];
		}
		int av = 0;
		for (int i = 0; i < num; i++) {
			av += money[i];
		}
		av /= num;
		int counter = 0;
		for (int i = 0; i < num; i++) {
			if (money[i] <= av)counter++;
		}
		cout << counter << endl;
		cin >> num;
	}
	
}

C++: 
#include <stdio.h>

int main()
{
	int i = 0;
	int n = 0;
	int ave = 0;
	int* a = new int[10000];
	int cnt = 0;

	while (1) {
		
		scanf("%d", &n);

		if (n == 0)break;

		while (1) {
			scanf("%d", &a[i]);
			i++;
			if (i >= n)break;
		}

		for (i = 0; i < n; i++) {
			ave += a[i];
		}
		ave /= n;

		for (i = 0; i < n; i++) {
			if (a[i] <= ave)cnt++;
		}

		printf("%d\n", cnt);

		i = 0;
		n = 0;
		ave = 0;
		for (i = 0; i < n; i++) {
			a[i] = 0;
		}
		cnt = 0;
	}

    return 0;
}

C++: #include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <utility>
#include <string>
#include <stack>
#include <regex>
#include <numeric>
#include <queue>
#include <set>

#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(v) (v).begin(), (v).end()

using namespace std;

typedef long long ll;

int main(int argc, char const *argv[])
{
  while (true)
  {
    ll n;
    cin >> n;
    if (n == 0)
      return 0;
    ll mean = 0;
    vector<ll> a(n);
    REP(i, n)
    {
      cin >> a[i];
      mean += a[i];
    }
    ll res = 0;
    REP(i, n)
    {
      if (a[i] * n <= mean)
        res++;
    }
    cout << res << endl;
  }
  return 0;
}