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)
     }
}

Python: while True:
    M=0
    
    A=int(input())
    
    if A==0:
        break
    
    L=list(map(int,input().split()))
    
    B=sum(L)/len(L)
    
    for i in range(A):
        if L[i]<=B:
            M+=1
            
    print(M)

Python: while True:
    n = int(input())
    if n == 0:
        break
    a = list(map(int,input().split()))
    ave = sum(a)/n
    ans = 0
    for i in range(n):
        if a[i] <= ave:
            ans += 1
    print(ans)

Python: anslist = []

while True:
    n = int(input())
    if n == 0:
        break
    a = list(map(int, input().split()))
    ans = 0
    ave = sum(a) / n
    for i in range(n):
        if a[i] <= ave:
            ans += 1

    anslist.append(ans)

for i in anslist:
    print(i)

Python: while True:
    n=int(input())
    if n == 0: break
    xs=list(map(int,input().split()))
    ave=sum(xs)/n
    print(sum(1 for x in xs if x <= ave))

Python: #!/usr/bin/python3

import array
from fractions import Fraction
import functools
import itertools
import math
import os
import sys


def main():
    while True:
        N = read_int()
        if N == 0:
            break
        A = read_ints()
        print(solve(N, A))


def solve(N, A):
    avg = Fraction(sum(A), N)
    return len([a for a in A if a <= avg])


###############################################################################
# AUXILIARY FUNCTIONS

DEBUG = 'DEBUG' in os.environ


def inp():
    return sys.stdin.readline().rstrip()


def read_int():
    return int(inp())


def read_ints():
    return [int(e) for e in inp().split()]


def dprint(*value, sep=' ', end='\n'):
    if DEBUG:
        print(*value, sep=sep, end=end)


if __name__ == '__main__':
    main()

Python: while(True):
    N=int(input())
    if N==0:
        break
    a=[int(i) for i in input().split()]
    S=sum(a)
    ans=0
    for i in range(N):
        if a[i]*N<=S:
            ans+=1
    print(ans)

Python: while True:
    n=int(input())
    if n==0:
        break
    a=list(map(int,input().split()))
    ans=0
    ave=sum(a)/n
    for i in range(n):
        if a[i]<=ave:
            ans+=1
    print(ans)

C++: //#include<bits/stdc++.h>
#include<iostream>
#include<stdio.h>
#define pi 3.141592653897932384626
#define abs(x) ((x)>0?(x):(-(x)))
#define eps (double)(0.0000001)
#define fs first
#define se second
//freopen("in.txt","r",stdin);freopen("out.txt","w",stdout);
using namespace std;
long a[1000];
int main()
{
    long n;
    cin>>n;
    while(n){
        long s=0,x=0;
        for(long i=0;i<n;++i){scanf("%ld",&a[i]);s+=a[i];}
        s/=n;
        for(long i=0;i<n;++i){if(a[i]<=s)++x;}
        cout<<x<<endl;
        cin>>n;
    }
    return 0;
}

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

int main(){
    int n;
    
    while(1){
        cin >> n;
        if(n == 0) return 0;
        int a[n];
        for (int i = 0; i < n; i++) cin >> a[i];
        int goukei = 0;
        for(int i = 0; i < n; i++) goukei = goukei + a[i];
        int heikin = goukei / n;
        int ans=0;
        for(int i = 0; i < n; i++){
            if(a[i] <= heikin) ans++;
        }
        cout << ans << endl;
    }
    return 0;
}

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

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

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1e9 + 7;
const ll inf = (1 << 30) - 1;
const ll infll = (1LL << 61) - 1;

double n;

int main()
{
    while (cin >> n)
    {
        if (n == 0)
            return 0;
        vector<double> v;
        double sum = 0;
        for (int i = 0; i < n; i++)
        {
            double k;
            cin >> k;
            v.push_back(k);
            sum += k;
        }
        sum /= n;
        int ans = 0;
        for (int i = 0; i < n; i++)
        {
            if (v[i] <= sum)
                ans++;
        }
        cout << ans << endl;
    }
}

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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  while (true) {
    int n;
    cin >> n;
    if (n == 0) return 0;
    
    vector<int> a(n);
    int sum = 0;
    for (int i = 0; i < n; i++) {
      cin >> a.at(i);
      sum += a.at(i);
    }
    
    int ans = 0;
    for (int i = 0; i < n; i++) {
      if (a.at(i) * n <= sum) ans++;
    }
    
    cout << ans << '\n';
  }
}

C++: // 2018/12/09 Tazoe

#include <iostream>
using namespace std;

int main()
{
	while(true){
		int n;
		cin >> n;

		if(n==0)
			break;

		int a[10000];
		int sum = 0;
		for(int i=0; i<n; i++){
			cin >> a[i];
			sum += a[i];
		}

		int ave = sum/n;
		int cnt = 0;

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

		cout << cnt << endl;
	}

	return 0;
}

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

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

    while (true) {
        int n, ans = 0, mean = 0;
        cin >> n;
        if (n == 0) {
            break;
        }
        int a[n];
        for (int i = 0; i < n; i++) {
            cin >> a[i];
            mean += a[i];
        }
        mean /= n;
        for (int i = 0; i < n; i++) {
            if (a[i] <= mean) {
                ans++;
            }
        }
        cout << ans << endl;
    }
}

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

using namespace std;

int main(){
    int n;
    cin >> n;
    while(n!=0){
      int sum=0,count=0;
      vector<int> a(n);
      for(int i=0;i<n;i++){
          cin >> a[i];
          sum += a[i];
      }
      for(int j=0;j<n;j++){
          if(a[j]<=sum/n){
              count++;
          }
      }
      cout << count << endl;
      cin >> n;
    }
    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;

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

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

using namespace std;
#define REP(i,n) for(int i=0;i<(n);i++)

vector<int>a[50505];
int N[50505];
double ave[50505];
int main() {
	int cnt = 0;
	REP(i, 100010) {
		cin >> N[i];
		if (N[i] == 0)break;
		cnt++;
		ave[i] = 0;
		REP(j, N[i]) {
			int x; cin >> x;
			a[i].push_back(x);
			ave[i] += x;
		}
	}
	//cout << cnt << endl;
	REP(i, cnt) {
		ave[i] /= N[i];
		int ans = 0;
		REP(j, N[i]) {
			if (a[i][j] <= ave[i]) {
				ans++;
			}
		}
		cout << ans << endl;
	}
}