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>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=998244353,MAX=100005,INF=1<<28;

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    while(1){
        int N;cin>>N;
        int sum=0,cnt=0;
        if(N==0) break;
        
        vector<int> A(N);
        
        for(int i=0;i<N;i++){
            cin>>A[i];
            sum+=A[i];
        }
        
        for(int i=0;i<N;i++){
            if(A[i]*N<=sum) cnt++;
        }
        
        cout<<cnt<<endl;
    }
}

C++: #include <iostream>
using namespace std;
int main()
{
	int N;
	int a[10000];
	int sum = 0;
	
	while (1)
	{
		sum = 0;
		cin >> N;
		if (N == 0) {
			return 0;
		}
		for (int i = 0; i < N; i++) {
			cin >> a[i];
			sum = sum + a[i];

		}
		int H;
		H = sum / N;
		int count = 0;
		for(int j=0; j<N; j++){
			
			if (a[j] <= H) {
				count = count + 1;
			}
			


		
			


		}
		cout << count << endl;

	}
	return 0;
}

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

using namespace std;

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

inline int toInt(string s) {int v; istringstream sin(s);sin>>v; return v;}

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector< vector<int> > Mat;
typedef tuple<int, int, int, int> T;

const int MOD = (int)1e9+7;
const int INF = (int)1e9;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};

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

    int n;
    while(1){
        cin >> n;
        if(n == 0) break;
        vector<int> a(n);
        double ave = 0;
        rep(i, n){
            cin >> a[i];
            ave += a[i];
        }
        ave /= n;

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

        cout << ans << endl;
    }

    return 0;
}

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

int main() {
  int n;
  while(cin >> n){
    if(n==0) return 0;
    vector<int> v(n);
    rep(i, n) cin >> v[i];
    int sum = accumulate(v.begin(), v.end(), 0);
    int cnt = 0;
    rep(i, n){
      if(v[i]<=sum/n) cnt++;
    }
    cout << cnt << endl;
  }
  return 0;
}

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

int main() {
    while(true){
    double sum=0;
    double a[50000];
    double n;
    cin >> n;

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

    cout << cnt<<endl;
    }

    return 0;
}

C++: #include <iostream>
using namespace std;
typedef long long ll;
ll n,a[100000],ans,rans;
int main(void){
    while(1){
        rans=0;
        ans=0;
        cin>>n;
        if(n==0)return 0;
        for(int i=0;i<n;i++){
            cin>>a[i];
            ans+=a[i];
        }
        for(int i=0;i<n;i++){
            if(a[i]*n<=ans)rans++;
        }
        cout<<rans<<endl;
    }
}

C++: #include <cstdio>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <map>
#include <stack>
#include <set>

int main()
{
    int n;
    while(scanf("%d",&n)==1){
        if(n==0){
            break;
        }
        else{
            double a[100000];
            for(int i=0;i<n;i++){
            scanf("%lf",&a[i]);
            }
            double sum = 0;
            for(int i=0;i<n;i++){
                sum += a[i];
            }
            double h = sum/n;
            int count = 0;
            for(int i=0;i<n;i++){
                if(a[i]<=h){
              count++;
                }
            }
            printf("%d\n",count);

        }
    }
    return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define loop(i, s, n) for (int i = s; i < n; i++)
#define erep(e, v) for (auto &&e : v)
#define all(in) in.begin(), in.end()
#define MP make_pair
#define INF (sizeof(int) == 4 ? (int) 1e9 : (int) 1e18)
#define EPS 0.0000000001
using namespace std;
template <class T, class S> void cmin(T &a, const S &b) {
    if (a > b) a = b;
}
template <class T, class S> void cmax(T &a, const S &b) {
    if (a < b) a = b;
}
template <typename Head, typename Value>
auto vectors(const Head &head, const Value &v) {
    return vector<Value>(head, v);
}
template <typename Head, typename... Tail> auto vectors(Head x, Tail... tail) {
    auto inner = vectors(tail...);
    return vector<decltype(inner)>(x, inner);
}
template <class T, class S> void join(T &a, S terminator) {
    for (auto itr = begin(a); itr != end(a); itr++) {
        if (itr != begin(a)) cout << terminator;
        cout << *itr;
    }
    cout << endl;
}
int W, H;
int dx[] = {0, 0, 1, -1}, dy[] = {1, -1, 0, 0};
bool valid(int x, int y) { return (0 <= x && x < W) && (0 <= y && y < H); }
auto out(int a, int b) {
    (a > b ? a += 1 : b += 1);
    cout << a << " " << b << endl;
}
main() {
    int n, m;
    while (cin >> n, n) {
        vector<double> v(n);
        erep(e, v) cin >> e;
        sort(all(v));
        double avg = accumulate(all(v), 0.0) / n;
        auto itr   = upper_bound(all(v), avg);
        cout << (itr == v.end() ? n : itr - v.begin()) << endl;
    }
}

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

using namespace std;
int main(){
    int n;
    while(cin>>n){
        if(n==0)break;
        vector<int> v(n);
        int ave=0;
        for(int i=0;i<n;i++){
            cin>>v[i];
            ave+=v[i];
        }
        ave/=n;
        int ans=0;
        for(int i=0;i<n;i++){
            if(ave>=v[i])ans++;
        }
        cout<<ans<<endl;
    }
}

C++: #include <bits/stdc++.h>
#define ll long long
#define INF 1000000000
using namespace std;
int main(){
    int N,sum;
    while(1){
        sum = 0;
        cin >> N;
        if(N==0) return 0;
        int A[N];
        for(int i=0;i<N;i++){
            cin >> A[i];
            sum += A[i];
        }
        double ave = (double)sum/N;
        int ans = 0;
        for(int i=0;i<N;i++){
            if(A[i]<=ave) ans++;
        }
        cout << ans << endl;
    }
}

C++: //QWsin
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define rep(i,x,y) for(int i=x;i<=y;++i)
using namespace std;

const int maxn=10000+10;
int a[maxn];

typedef long long ll;

int main()
{
	int n;
	while(scanf("%d",&n) && n)
	{
		ll sum=0;
		rep(i,1,n) scanf("%d",a+i),sum+=a[i];
		sort(a+1,a+n+1);
		
		int ans=0;
		rep(i,1,n) if(1ll*a[i]*n <= sum) ++ans;
		cout<<ans<<endl;
	}
	return 0;
}