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 <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <bitset>
#include <map>
#include <tuple>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <numeric>
#include <utility>
#include <iterator>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <ctime>
#include <cassert>
#include <random>
#include <cstring>


#define rep(i,n) for(int i=0;i<int(n);i++)
#define all(x) (x).begin(),x.end()
#define pb push_back

using namespace std;
using ll = long long;

const ll mod = 1000000007;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int ddx[8]={-1,-1,0,1,1,1,0,-1};
int ddy[8]={0,1,1,1,0,-1,-1,-1};
bool debug=false;

/*---------------------------------------------------*/

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];
    }
    double ave = (double)sum / n;
    int cnt = 0;
    for(int i = 0; i < n; i++){
      cnt += (a[i] <= ave);
    }
    cout << cnt << endl;
  }
  return 0;
}

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

int main(){
    while(1){

    int n,sum=0; cin>>n;

    if(n ==0) break;

    vector<int> inc(n);

    for(int i=0; i<n; i++){

        cin>>inc.at(i);

        sum += inc.at(i);
    }


    int count=0,avg = sum / n;

    for(int i=0; i<n; i++){

        if( avg >= inc.at(i)) count++;
    }

    cout<<count<<endl;
    }

    return 0;
}

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

#define ALL(v) (v).begin(), (v).end()
#define rep(i, n) for (ll i = 0, __##i##_length = (n); i < __##i##_length; i++)
#define rep_reverse(i, n) for (ll i = (n)-1; 0 <= i; i--)
#define FOR(i, from, to) for (ll i = (from), __##i##_end = (to); i < __##i##_end; i++)
#define FOR_REVERSE(i, from, to) for (ll i = (to)-1, __##i##_end = (from); __##i##_end <= i; i--)
#define foreach(e, v) for (const auto e : (v))
#define vfree(v) std::vector<int>().swap(v)
#define DEBUG(x) cout << #x << " = " << (x) << endl

using namespace std;
typedef int64_t ll;
typedef vector<ll> llv;
typedef vector<llv> llvv;

ll gcd(ll a, ll b)
{
    return (a < b) ? gcd(b, a) : ((a % b) ? gcd(b, a % b) : b);
}

ll lcm(ll a, ll b)
{
    return a * b / gcd(a, b);
}

ll powmod(ll x, ll p, ll m)
{
    if (p == 0)
        return 1;
    if (p & 1)
        return powmod(x, p - 1, m) * x % m;
    ll r = powmod(x, p / 2, m);
    return r * r % m;
}

constexpr ll MOD = 1000000007;

int main()
{
    ll N;
    cin >> N;
    while (N != 0)
    {
        llv A(N);
        ll sum = 0;
        rep(i, N)
        {
            cin >> A[i];
            sum += A[i];
        }
        ll ans = 0;
        rep(i, N)
        {
            ans += (A[i] * N <= sum);
        }
        cout << ans << endl;
        cin >> N;
    }

    return 0;
}

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

int main(){
	int n;
	while(cin >> n,n){
		vector<double> a(n);
		rep(i,n) cin >> a[i];

		double ave = accumulate(a.begin(), a.end(), 0.0) / n;

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

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

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

C++: #include<stdio.h>
#include<iostream>
#include<vector>
using namespace std;
int main(){
    double n;
    while(cin >>n && n){
        vector<int> A(n);
        double sum=0;
        for(int i=0; i<n; i++){
            cin >> A[i];
            sum+= A[i];
        }
        double ave= sum/n;
        int ans=0;
        for(int i=0; i<n; i++){
            if(ave>=A[i]) ans++;
        }
        cout << ans << '\n';
    }
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <limits>
#include <cmath>
#include <cassert>

using namespace std;
using ll = long long;

const int INF = 1<<30;
const int MOD = (int)1e9 + 7;
const int MAX_N = (int)1e5 + 5;
#define debug(x) cout << #x << ": " << x << endl

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    while(cin >> n, n)
    {
        vector<int> v(n);
        for(int i = 0; i < n; i++) cin >> v[i];
        int avg = 0;
        for(int i = 0; i < n; i++) avg += v[i];
        avg /= n;
        int ans = 0;
        for(int i = 0; i < n; i++)
        {
            if(v[i] <= avg) ans++;
        }
        cout << ans << endl;
    }
    return 0;
}

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

#define COUNTOF(array) (sizeof(array) / sizeof(array[0]))    
#define OUT(P) cout << (P) << endl    
#define OUT2(P1, P2) cout << (P1) << " " << (P2) << endl    
#define PRINT_ARRAY(P) for(int i=0; i<P.size(); i++) cout << P[i] << endl;    
#define PRINT_ARRAY_INLINE(P) do { for(int i=0; i<P.size(); i++) cout << P[i] << " "; cout << endl; } while(0)    
#define PRINT_ARRAY_WITH_LABEL(L, P) do { cout << L << ": "; PRINT_ARRAY_INLINE(P); cout << endl; } while(0)    
typedef long long ll;    

int sum_digits(int num);    
template <class T>    
vector<T> copy_vector(vector<T> vec);    
int gcd(int a, int b);    

int main() {    
    int n;
    cin >> n;
    while(n != 0) {
        vector<int> a(n);
        for(int i=0; i<n; i++) {
            cin >> a[i];
        }
        int ave = accumulate(a.begin(), a.end(), 0) / n;
        sort(a.begin(), a.end());
        int cnt = 0;
        for(int i=0; i<n && a[i] <= ave; i++) {
            cnt++;
        }
        cout << cnt << endl;

        cin >> n;
    }

    return 0;    
}    

/******************************/    
/***** DECRARED FUNCTIONS *****/    
/******************************/    

int sum_digits(int num) {    
    int rtn = 0;    
    while(num != 0) {    
        int tmp = num % 10;    
        rtn += tmp;    
        num /= 10;    
    }    
    return rtn;    
}    

// vectorのコピー    
template <class T>    
vector<T> copy_vector(vector<T> vec) {    
    vector<T> rtn;    
    rtn.reserve(vec.size());    
    copy(vec.begin(), vec.end(), back_inserter(rtn));    
    return rtn;    
}    

// ユークリウッドの互除法    
int gcd(int a, int b) {    
    if(b==0) return a;    
    else return gcd(b, a % b);    
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<map>
#include<vector>
#include<queue>
#include<stack>
#include<climits>
#include<set>
#include<utility>
#include<typeinfo>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef set<int> S;
#define rep(i, n) for(int i=0; i<n; i++)
const ll MOD=1e9+7;

int main(){

	int n;
	double a[10000];
	while(cin >> n && n){
		int ans = 0;
		double ave = 0;
		for(int i = 0; i < n; i++){
			cin >> a[i];
			ave += a[i];
		}
		ave /= n;
		for(int i = 0; i < n; i++){
			if(a[i] <= ave){
				ans++;
			}
		}
		cout << ans << endl;
	}

	return 0;
}