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 INF 1e18
#define int long long
#define Rep(i, a, n) for (int i = (a); i < (n); i++)
#define Repr(i, n, a) for (int i = (n); i >= (a); i--)
#define rep(i, n) Rep(i, 0, n)
#define repr(i, n) Repr(i, n, 0)
#define all(a) (a).begin(), (a).end()
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> PP;
const int mod = 1000000007;

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

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

C++: #include <bits/stdc++.h>

using namespace std;
using ll = long long;
// #define int ll
using PII = pair<ll, ll>;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()

template<typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template<typename T> bool IN(T a, T b, T x) { return a<=x&&x<b; }
template<typename T> T ceil(T a, T b) { return a/b + !!(a%b); }

template<typename T> vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts) {
    return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type
fill_v(T &t, const V &v) { t=v; }
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t, const V &v ) { for(auto &e:t) fill_v(e,v); }

template<class S,class T>
ostream &operator <<(ostream& out,const pair<S,T>& a) {
    out<<'('<<a.first<<','<<a.second<<')'; return out;
}
template<class T>
ostream &operator <<(ostream& out,const vector<T>& a){
    out<<'[';
    for(const T &i: a) out<<i<<',';
    out<<']';
    return out;
}
template<class T>
ostream &operator <<(ostream& out, const set<T>& a) {
    out<<'{';
    for(const T &i: a) out<<i<<',';
    out<<'}';
    return out;
}
template<class T, class S>
ostream &operator <<(ostream& out, const map<T,S>& a) {
    out<<'{';
    for(auto &i: a) out<<i<<',';
    out<<'}';
    return out;
}

int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0}; // DRUL
const int INF = 1<<30;
const ll LLINF = 1LL<<60;
const ll MOD = 1000000007;

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

    while(1) {
        ll n;
        cin >> n;
        if(!n) break;
        vector<ll> a(n);
        REP(i, n) cin >> a[i];

        ll ave = 0;
        REP(i, n) ave += a[i];

        ll ret = 0;
        REP(i, n) if(a[i]*n <= ave) ret++;

        cout << ret << endl;
    }

    return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1

ll mod_add(ll a, ll b) { return (a + b) % MOD; }
ll mod_sub(ll a, ll b) { return (a - b + MOD) % MOD; }
ll mod_mul(ll a, ll b) { return a*b % MOD; }

ll n;
ll sum;

bool c(ll a){
    return a * n <= sum;
}

int main(){
    while(cin >> n && n){
        sum = 0;
        vector<ll> v(n);
        rep(i,n){
            cin >> v[i];
            sum += v[i];
        }
        ll ans = 0;
        rep(i,n){
            if(c(v[i]))ans++;
        }
        cout << ans << endl;
    }
}

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

using namespace std;

int main(void){
    // Your code here!
    while(true){
        int N;
        cin >> N;
        if(N == 0){
            break;
        }
        vector<int> income;
        int ans = 0;
        int average = 0;
        for(int i=0;i<N;i++){
            int value;
            cin >> value;
            income.push_back(value);
            average += value;
        }
        average /= N;
        for(int i=0;i<N;i++){
            if(average >= income[i]){
                ans++;
            }
        }
        cout<< ans<<endl;
    }
    return 0;
}

C++: #include<bits/stdc++.h>

#define ll long long
#define fornum(A,B,C) for(A=B;A<C;A++)
#define mp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>

using namespace std;

/////////////////////////////////////////////////////
ll n,a[101010];
ll i, j, k;
int main(){
    
    scanf("%lld", &n);
    while(n){
        ll ans = 0;
        ll ave = 0;
        fornum(i,0,n){
            scanf("%lld", &a[i]);
            ave += a[i];
        }
        ave = ave / n;
        fornum(i,0,n){
            if(a[i]<=ave){
                ans++;
            }
        }
        printf("%lld\n",ans);
        scanf("%lld", &n);
        k++;
    }
    return 0;
}

C++: //#include <bits/stdc++.h>
#include <string>
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <utility>
#include <climits>

using namespace std;
using ll=long long;

void solve(){
  while(1){
  int num;
  cin >> num;if(num==0)return;
  int ar[num];
  for(int i=0;i<num;i++)
    cin >> ar[i];
  int sum=0;
  for(int i=0;i<num;i++)
    sum+=ar[i];
  sum/=num;
  int ct=0;
  for(int i=0;i<num;i++)
    ct+=ar[i]<=sum;
  cout << ct << endl;
}}

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

C++: #include <iostream>
#include <utility>
#include <string>
#include <algorithm>
#include <map>
#include <vector>
#include <climits>
#include <numeric>
#include<stdio.h>
#include <queue>
#include <iomanip>
#include <float.h>
#include <set>
#include<functional>
#include <stack>
#include <time.h>
#include <climits>
#include <bitset>
#include <fstream>
using namespace std;
typedef pair<int, int>p;
int main(int argc, char* argv[]) {
	int n;
	int a[10004];
	while (1) {
		cin >> n;
		if (n == 0)break;
		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++) {
			if (a[i] * n <= sum)ans += 1;
		}
		cout << ans<<"\n";
	}
}

C++: #include <bits/stdc++.h>
#include <assert.h>

using namespace std;

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

  return 0;
}

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

int solve(int N) {
    vector<int> A(N);
    int sum = 0;
    for (int i = 0; i < N; i++) {
        cin >> A[i];
        sum += A[i];
    }
    sort(A.begin(), A.end());
    auto Itere = upper_bound(A.begin(), A.end(), sum / N);
    return Itere - A.begin();
}

int main() {
    int N;
    vector<int> ans;
    while (cin >> N) {
        if (!N) break;
        ans.push_back(solve(N));
    }

    for (int i : ans) cout << i << endl;
}