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"

#include <iostream>
#include <vector>
// #include <map>
// #include <string>
#include <algorithm>
// #include <numeric>
// #include <limits>

using namespace std;

int main() {
	int n;
	while (1) {
		cin >> n;
		if (n == 0) {
			break;
		}
		int count = 0;
		vector<int> vec(n, 0);
		for (int i = 0; i < n; i++) {
			cin >> vec[i];
		}
		double mean = accumulate(vec.begin(), vec.end(), 0.0) / vec.size();
		sort(vec.begin(), vec.end());
		for (auto itr = vec.begin(); itr < vec.end(); itr++) {
			if (*itr <= mean) {
				count++;
			} else {
				break;
			}
		}
		cout << count << endl;
	}
	// std::cout << "\e[38;5;0m\e[48;5;40m --- end ---  \e[m" << std::endl; // debug
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int n, a[100000], sum; //sumはn人の平均値の合計
    int num;  //numは平均値以下の所得者数
    
    while(true){
        cin >> n;
        if(n == 0) break;
        
        sum = 0;
        num = 0;

        for(int i = 0; i < n; i++){  
            cin >> a[i];
            sum += a[i];
        }
        int mean = sum / n;
        for(int i = 0; i < n; i++){
            if(a[i] <= mean) num++;
        }
        cout << num << endl;
    }
}

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

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

using namespace std;

#define rep(i, n) for(int i = 0; i < (n); i++)

int n;
vector<int> a;

void solve() {
    double avg = 0;
    rep(i, n) avg += a[i];
    avg /= n;
    int ans = 0;
    rep(i, n) if (a[i] <= avg) ans++;
    cout << ans << endl;
}

int main() {
    while(cin >> n, n) {
        a.clear();
        a.resize(n);
        rep(i, n) cin >> a[i];
        solve();
    }
}

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


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

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
#define MAX 100100

int n;
int a[MAX];

int main() {
  scanf("%d", &n);

  while(n) {
    int average = 0, cnt = 0;
    for(int i=0; i<n; ++i) {
      scanf("%d", &a[i]);
      average += a[i];
    }

    average /= n;

    for(int i=0; i<n; ++i)
      if(a[i]<=average) ++cnt;

    printf("%d\n", cnt);
    scanf("%d", &n);
  }

  return 0;
}

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

int main() {
	while (true) {
		double n;
		cin >> n;
		if (n == 0) break;
		vector<int> a(n);
		for (int i = 0; i < n; i++) cin >> a[i];

		double sum = 0;
		for (int i = 0; i < n; 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;
	}
}

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

#define int long long

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  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 ( a[i]*n <= sum ) ans++;
    }

    cout << ans << endl;
  }
  
  return 0;
}

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

int main(){
  int n;
  while(cin>>n && n){
    int sum=0;
    vector<int> t(n);
    for(int i=0;i<n;i++){
      cin>>t[i];
      sum+=t[i];
    }
    int ans=0;
    for(int i=0;i<n;i++){
      if( t[i]*n <= sum )ans++;
    }
    cout<<ans<<endl;
  }
  
  return 0;
}

C++: #include<bits/stdc++.h>
#define MAX 10005
using namespace std;
double a[MAX];
int main()
{
    int n;
    while(scanf("%d",&n)!=EOF&&n)
    {
        double sum=0;
        int res=0;
        for(int i=0;i<n;i++)
        {
            scanf("%lf",&a[i]);
            sum+=a[i];
        }
        sum/=(double)n;
        for(int i=0;i<n;i++)
            if(a[i]<=sum)res++;
        printf("%d\n",res);
    }
}

C++: #include<iostream>
using namespace std;
int t[100005];
int main(){
	long long int n;
	int i,j,k;
	long long int a,b,c;
	while(cin>>n){
		if(!n)break;
		a=0;
		for(i=0;i<n;i++){
			cin>>t[i];
			a+=t[i];
		}
		a/=n;
		b=0;
		for(i=0;i<n;i++){
			if(t[i]<=a)b++;
		}
		cout<<b<<endl;
	}
}

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

int main() {
	while (true) {
		double n;
		cin >> n;
		if (n == 0) break;
		vector<int> a(n);
		for (int i = 0; i < n; i++) cin >> a[i];

		double sum = 0;
		for (int i = 0; i < n; 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 << "\n";
	}
}

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

int main(){
    while(true){
        int n;
        cin>>n;
        if(!n)return 0;
        int a[n];
        double total=0;
        for(int i=0;i<n;i++){
            cin>>a[i];
            total += a[i];
        }
        double average=total/n;
        
        int lower_pep=0;
        for(int i=0;i<n;i++){
            if(a[i]<=average)lower_pep++;
        }
        cout<<lower_pep<<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,0);
    for(int i=0;i<n;i++){
        cin>>a.at(i);
    }
    int ave=0;
    for(int i=0;i<n;i++){
        ave+=a.at(i);
    }
    ave=ave/n;
    int ans=0;
    for(int i=0;i<n;i++){
        if(a.at(i)<=ave){
            ans++;
        }
    }
    cout<<ans<<endl;
    }
}

C++: #include <iostream>
using namespace std;
int main(void){
    int n, a[10000]={};
    long int sum;
    
    while(true){
        sum=0;
        cin >> n;
        if(n == 0) break;
        for(int i=0; i<n; i++){
            cin >> a[i];
            sum += a[i];
        }
        double ave = sum/n;
        int count = 0;
        for(int i=0; i<n; i++){
            if(ave >= a[i]) count++;
        }
        cout << count << endl;
    }
    return 0;
}

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

int main() {
  int n;
  while (cin >> n, n) {
    vector<int> a(n);
    int s = 0;
    for (auto &e : a) {
      cin >> e;
      s += e;
    }
    double m = (double)s / n;
    int r = 0;
    for (auto e : a) {
      r += e <= m;
    }
    cout << r << endl;
  }
}

C++: #include <algorithm>
#include <cstring>
#include <cmath>
#include <cstdio>

using namespace std;

const int MAX_N = 10005;
int arr[MAX_N];

int main() {
    int n;
    scanf("%d", &n);
    while (n != 0) {
        int sum = 0;
        for (int i = 0; i < n; ++i) {
            scanf("%d", arr + i);
            sum += arr[i];
        }
        int cnt = 0;
        for (int j = 0; j < n; ++j) {
            if (arr[j] * n <= sum)
                cnt++;
        }
        printf("%d\n", cnt);
        scanf("%d", &n);
    }
    return 0;
}