Go: package main

import "fmt"

func main() {

     for ; true ; {
     var n int
     fmt.Scan(&n)
     if n == 0 { break }
     a := make([]float64, n)
     var sum float64 = 0
     for i := 0; i < n; i++ {
     	 fmt.Scan(&a[i])
	 sum += float64(a[i])
     }
     sum /= float64(n)
     ans := 0
     for i := 0; i < n; i++ {
     	 if a[i] <= sum {
	    ans += 1
	 }
     }
     fmt.Println(ans)
     }
}

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;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;
int a[10050];

int main() {
    //cout.precision(10);
    cin.tie(0);
    ios::sync_with_stdio(false);
    while(true) {
        int n;
        cin >> n;
        if(n == 0) break;
        int sum = 0;
        for(int i = 1; i <= n; i++) {
            cin >> a[i];
            sum += a[i];
        }
        int ans = 0;
        for(int i = 1; i <= n; i++) {
            if(a[i] * n <= sum) ans++;
        }
        cout << ans << endl;
    }
    return 0;
}

C++: #include <iostream>
using namespace std;
typedef long long ll;
int main(void){
    // Your code here!
    ll n;
    cin>>n;
    ll s[n];
    ll tot=0;
    for(int i=0;i<n;i++){
        cin>>s[i];
        tot+=s[i];
    }
    ll ans=0;
    for(int i=0;i<n;i++){
        if(tot/n>=s[i])ans++;
    }
    cout<<ans<<endl;
}

C++: #include <bits/stdc++.h>
#define rep(i, a, b) for(ll i = ll(a); i < ll(b); i++)
#define rer(i, a, b) for(ll i = ll(a) - 1; i >= ll(b); i--)
#define sz(v) (int)(v).size()
#define pb push_back
#define sc second
#define fr first
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
using namespace std;
typedef long long int ll;
typedef pair <int, int> P;

const ll MOD=1000000007;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    for(;;){
        int n;
        cin>>n;
        if(!n){
            return 0;
        }
        vector<double> v(n);
        double a=0;
        rep(i,0,n){
            cin>>v[i];
            a+=v[i];
        }
        a/=n;
        int cnt=0;
        rep(i,0,n){
            if(v[i]<=a) cnt++;
        }
        cout <<cnt<<"\n";
    }
}

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

using namespace std;

#define REP(i, n) for (int i = 0; i < (n); i++)
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define int long long
bool solve() {
    int N;
    cin >> N;
    if (N == 0) return false;
    vector<int> A(N);
    int sum = 0;
    REP(i, N) {
        cin >> A[i];
        sum += A[i];
    }
    int ans = 0;
    REP(i, N) {
        if (A[i] * N <= sum) ans++;
    }
    cout << ans << endl;
    return true;
}
signed main() {
    while (solve())
        ;
}

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

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

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

void solve(int n)
{
    vector<int> v(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }

    int sum = accumulate(v.begin(), v.end(), 0);
    double ave = double(sum) / n;
    sort(v.begin(), v.end());
    int count = upper_bound(v.begin(), v.end(), ave) - v.begin();
    cout << count << '\n';
}

int main()
{
    int n;
    cin >> n;
    while (n) {
        solve(n);
        cin >> n;
    }
}

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

using namespace std;
using ll=long long;
using ull=unsigned long long;
using pii=pair<int,int>;

#define INF LONG_MAX
#define MOD 1000000007
#define rng(a) a.begin(),a.end()
#define rrng(a) a.end(),a.begin()

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

  while(true){
    int n;
    cin>>n;
    if(n==0)return 0;
    vector<int>a(n);
    for(int i=0;i<n;i++)cin>>a[i];
    int sum=0;
    for(auto it:a)sum+=it;
    // sum/n >= a[i]
    //   |
    //   V
    // sum >= a[i]*n
    int ans=0;
    for(auto it:a)if(sum>=it*n)ans++;
    cout<<ans<<endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define all(c) (c).begin(),(c).end()

using namespace std;
main(){
    while(1){
        ll n;cin>>n;
        if(!n)break;
        vector<ll> a(n);
        rep(i,n)cin>>a[i];
        ll sum = accumulate(all(a),0LL);
        int cnt = 0;
        rep(i,n){
            cnt += (a[i]*n <= sum);
        }
        cout << cnt <<endl;
    }
}

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

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

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

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++){
            if(n*a[i]<=sum) ans++;
        }
        cout << ans << endl;
    }
    return 0;
}