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>
using namespace std;
using ll = long long;
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
int main(){
  int n;
  while(cin >> n, n){
    vector<int> a(n);
    REP(i,n) cin >> a[i];
    double ave = accumulate(a.begin(),a.end(),0);
    ave /= n;
    int ans = 0;
    REP(i,n){
      if(a[i]<=ave) ans++;
    }
    cout << ans << endl;
  }
}

C++: #include <stdio.h>
typedef long long ll;

int main(void) {
  ll i, n;
  while( 1 ) {
    scanf("%lld", &n);
    if(!n) break;
    ll a[n], ans = 0, now = 0;
    for(i = 0; i < n; ++i) scanf("%lld", &a[i]), now += a[i];
    for(i = 0; i < n; ++i) if(now >= a[i] * n) ++ans;
    printf("%lld\n", ans);
  }
  return 0;
}

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

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

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

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)
#define all(a) (a).begin(),(a).end()

int main(void){
    int n;
    while(cin>>n, n){
        vector<int> a(n);
        rep(i,n){
            cin>>a[i];
        }
        int ave = accumulate(all(a), 0)/n;
        int cnt = 0;
        rep(i,n){
            if(a[i] <= ave) cnt++;
        }
        cout<<cnt<<endl;
    }  
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl;
#define INF 1000000000
#define mod 1000000007
using ll=long long;
const ll LINF=1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return true;}return false;}

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    
    while(true){
        ll n;cin>>n;
        if(n==0) return 0;
        vector<ll> a(n);
        ll sum=0;
        rep(i,n){
            cin>>a[i];
            sum+=a[i];
        }
        ll ave=sum/n;
        ll cnt=0;
        rep(i,n){
            if(a[i]<=ave) cnt++;
        }
        cout<<cnt<<endl;
    }
    return 0;
}

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

int main() {

  while (1) {

    int n;

    cin >> n;
    if (n == 0) break;

    vector<int> income(n, 0);
    
    int tmp = 0;
    int sum = 0;
    double ave;

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

    sort(income.begin(), income.end());
    int ans = 0;
    for (int i = 0; i < n; i++) {
      if (income[i] > ave)
        break;
      else
        ans += 1;
    }
    cout << ans << endl;
  }
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
  while (1){
    int n;
    cin >> n;
    if (n == 0){
      break;
    }
    vector<int> a(n);
    for (int i = 0; i < n; i++){
      cin >> a[i];
    }
    long long sum = 0;
    for (int i = 0; i < n; i++){
      sum += a[i];
    }
    int ans = 0;
    for (int i = 0; i < n; i++){
      if ((long long) a[i] * n <= sum){
        ans++;
      }
    }
    cout << ans << endl;
  }
}

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

using namespace std;
int b[100005];
int main()
{
	int n,i,s,a[100005];
	do
	{
		cin >> n;
		if(n!=0)
		{
		s=0;
		for(i=0; i<n; i++)
		{
			cin >> a[i];
			b[a[i]]++;
			s+=a[i];
		}
		s=s/n;
		for(i=1; i<=100000; i++)
			b[i]+=b[i-1];
		cout << b[s] << endl;
		for(i=0; i<=100000; i++)
			b[i]=0;
		}
	}while(n!=0);
}

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

#define int ll
#define rep(i,n) for(int i=0,i##_cond=(n);i<i##_cond;++i)
#define all(a) (a).begin(),(a).end()
#define SUM(a) accumulate(all(a),int(0))
using ll  = long long;
using vi  = vector<int>;

signed main(){
  int n;
  while(cin >> n, n){
    vi a(n);
    rep(i,n) cin >> a[i];

    int s = SUM(a);
    int ans = 0;
    rep(i,n){
      if(a[i]*n <= s) ans++;
    }
    cout << ans << endl;
  }
}

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

int main() {
    int n, a[100000];
    double ave = 0.0;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        ave += a[i];
    }
    ave /= n;
    int under = 0;
    for (int i = 0; i < n; ++i) {
        if (a[i] <= ave) {
            ++under;
        }
    }
    cout << under << endl;
    return 0;
}

C++: #include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
using LL = long long;
const LL LINF = 1e18;
const double EPS = 1e-10;
using namespace std;
class Edge{
public:
    int from,to,value;
    Edge(LL a,LL b,LL c){
        from = a;
        to = b;
        value = c;
    }
    Edge(LL a,LL b){
        from = a;
        to = b;
    }
};



int main(){
   int n;
   while(cin >> n){
       if(n == 0)return 0;
       vector<float> v;
       for(int i = 0;i < n;i++){
           float b;cin >> b;
           v.push_back(b);
       }
       float sum = accumulate(v.begin(), v.end(), 0.0) / n;
       int ans = 0;
       for(auto f : v){
           if(sum >= f)ans++;
       }
       cout<<ans<<endl;
   }
}

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

int main() {
	int N;
	while (cin >> N) {
		if (N == 0) return 0;
		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 (A[i] * N <= SUM) ANS++;
		}
		cout << ANS << endl;
	}
}

C++: #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define rev(i,n) for(int i=(n)-1;i>=0;i--)
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define pi pair<int,int>
#define vp vector<par<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define inf (1ll<<60)
#define Yes(f) cout<<(f?"Yes":"No")<<endl
#define yes(f) cout<<(f?"yes":"no")<<endl
#define YES(f) cout<<(f?"YES":"NO")<<endl
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v), greater<int>())

using namespace std;

const int mod=1e9+7;
const string sp=" ";

void run();

void init() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(12);
}

signed main(){
    init();
    run();
    return 0;
}
      
void run(){
    int n;
    cin>>n;
    if(n==0)return;
    vi a(n);
    int s=0;
    rep(i,n)cin>>a[i],s+=a[i];
    s/=n;
    int ans=0;
    rep(i,n)ans+=a[i]<=s;
    cout<<ans<<endl;
    run();
}