Buggy python submission (verdict: Runtime Error):
from heapq import *

def calcInk(wdt,val):
    maxval=val[-1]
    histnum=maxval//wdt
    hist=[]
    for i in range(histnum+1):
        hist.append([])
    vl=len(val)
    for i in range(vl):
        v=heappop(val)
        hist[v//wdt].append(v)
    
    highest=0
    for i in range(len(hist)):
        highest=max(highest,len(hist[i]))
    ink=0
    for i in range(len(hist)):
        ink+=(1-i/histnum)*(len(hist[i])/highest)
    return ink+0.01

if __name__=='__main__':
    while True:
        n,w=map(int,input().split())
        if n==w==0:
            break
        V=[]
        for _ in range(n):
            heappush(V,int(input()))

        print(calcInk(w,V))



Fixed submission:
while 1:
    n,w=map(int,input().split())
    if n==w==0:break
    a=[0]*100
    s=h=int(0)
    while n:
        b=int(input())
        a[b//w]+=1
        s=max(s,b//w)
        h=max(h,a[b//w])
        n-=1
    ans=0.01
    for i in range(int(s)+1):
        ans+=a[i]/h*(s-i)/s
    print(ans)

Buggy python submission (verdict: Runtime Error):
from heapq import *

def calcInk(wdt,val):
    maxval=val[-1]
    histnum=maxval//wdt
    hist=[]
    for i in range(histnum+1):
        hist.append([])
    vl=len(val)
    for i in range(vl):
        v=heappop(val)
        hist[v//wdt].append(v)
    
    highest=0
    for i in range(len(hist)):
        highest=max(highest,len(hist[i]))
    ink=0
    for i in range(len(hist)):
        ink+=(1-i/histnum)*(len(hist[i])/highest)
    return ink+0.01

if __name__=='__main__':
    while True:
        n,w=map(int,input().split())
        if n==w==0:
            break
        V=[]
        for _ in range(n):
            heappush(V,int(input()))

        print(calcInk(w,V))



Fixed submission:
while 1:
    n,w=map(int,input().split())
    if n==w==0:break
    a=[0]*100
    s=h=int(0)
    while n:
        b=int(input())
        a[b//w]+=1
        s=max(s,b//w)
        h=max(h,a[b//w])
        n-=1
    ans=0.01
    for i in range(int(s)+1):
        ans+=a[i]/h*(s-i)/s
    print(ans)

Buggy python submission (verdict: Runtime Error):
from heapq import *

def calcInk(wdt,val):
    maxval=val[-1]
    histnum=maxval//wdt
    hist=[]
    for i in range(histnum+1):
        hist.append([])
    vl=len(val)
    for i in range(vl):
        v=heappop(val)
        hist[v//wdt].append(v)
    
    highest=0
    for i in range(len(hist)):
        highest=max(highest,len(hist[i]))
    ink=0
    for i in range(len(hist)):
        ink+=(1-i/histnum)*(len(hist[i])/highest)
    return ink+0.01

if __name__=='__main__':
    while True:
        n,w=map(int,input().split())
        if n==w==0:
            break
        V=[]
        for _ in range(n):
            heappush(V,int(input()))

        print(calcInk(w,V))


Fixed submission:
while 1:
    n,w=map(int,input().split())
    if n==w==0:break
    a=[0]*100
    s=h=int(0)
    while n:
        b=int(input())
        a[b//w]+=1
        s=max(s,b//w)
        h=max(h,a[b//w])
        n-=1
    ans=0.01
    for i in range(int(s)+1):
        ans+=a[i]/h*(s-i)/s
    print(ans)

Buggy python submission (verdict: Runtime Error):
from heapq import *

def calcInk(wdt,val):
    maxval=val[-1]
    histnum=maxval//wdt
    hist=[]
    for i in range(histnum+1):
        hist.append([])
    vl=len(val)
    for i in range(vl):
        v=heappop(val)
        hist[v//wdt].append(v)
    
    highest=0
    for i in range(len(hist)):
        highest=max(highest,len(hist[i]))
    ink=0
    for i in range(len(hist)):
        ink+=(1-i/histnum)*(len(hist[i])/highest)
    return ink+0.01

if __name__=='__main__':
    while True:
        n,w=map(int,input().split())
        if n==w==0:
            break
        V=[]
        for _ in range(n):
            heappush(V,int(input()))

        print(calcInk(w,V))


Fixed submission:
while 1:
    n,w=map(int,input().split())
    if n==w==0:break
    a=[0]*100
    s=h=int(0)
    while n:
        b=int(input())
        a[b//w]+=1
        s=max(s,b//w)
        h=max(h,a[b//w])
        n-=1
    ans=0.01
    for i in range(int(s)+1):
        ans+=a[i]/h*(s-i)/s
    print(ans)

Buggy python submission (verdict: Runtime Error):
from heapq import *

def calcInk(wdt,val):
    maxval=val[-1]
    histnum=maxval//wdt
    hist=[]
    for i in range(histnum+1):
        hist.append([])
    vl=len(val)
    for i in range(vl):
        v=heappop(val)
        hist[v//wdt].append(v)
    
    highest=0
    for i in range(len(hist)):
        highest=max(highest,len(hist[i]))
    ink=0
    for i in range(len(hist)):
        ink+=(1-i/histnum)*(len(hist[i])/highest)
    return ink+0.01

if __name__=='__main__':
    while True:
        n,w=map(int,input().split())
        if n==w==0:
            break
        V=[]
        for _ in range(n):
            heappush(V,int(input()))

        INK=calcInk(w,V)
        print(INK)


Fixed submission:
while 1:
    n,w=map(int,input().split())
    if n==w==0:break
    a=[0]*100
    s=h=int(0)
    while n:
        b=int(input())
        a[b//w]+=1
        s=max(s,b//w)
        h=max(h,a[b//w])
        n-=1
    ans=0.01
    for i in range(int(s)+1):
        ans+=a[i]/h*(s-i)/s
    print(ans)

Buggy python submission (verdict: Runtime Error):
if __name__=='__main__':
    while True:
        n,w=map(int,input().split())
        if n==w==0:
            break
        V=[]
        for _ in range(n):
            heappush(V,int(input()))
            maxV=V[-1]

        histnum=maxV//w
        hist=[]
        for i in range(histnum+1):
            hist.append([])
        vl=len(V)
        for i in range(vl):
            v=heappop(V)
            hist[v//w].append(v)

        highest=0
        for i in range(len(hist)):
            highest=max(highest,len(hist[i]))
        ink=0
        for i in range(len(hist)):
            ink+=(1-i/histnum)*(len(hist[i])/highest)
        print(ink)


Fixed submission:
while 1:
    n,w=map(int,input().split())
    if n==w==0:break
    a=[0]*100
    s=h=int(0)
    while n:
        b=int(input())
        a[b//w]+=1
        s=max(s,b//w)
        h=max(h,a[b//w])
        n-=1
    ans=0.01
    for i in range(int(s)+1):
        ans+=a[i]/h*(s-i)/s
    print(ans)

Buggy python submission (verdict: Runtime Error):
from heapq import *

def calcInk(wdt,val):
    maxval=val[-1]
    histnum=maxval//wdt
    hist=[]
    for i in range(histnum+1):
        hist.append([])
    vl=len(val)
    for i in range(vl):
        v=heappop(val)
        hist[v//wdt].append(v)
    
    highest=0
    for i in range(len(hist)):
        highest=max(highest,len(hist[i]))
    ink=0
    for i in range(len(hist)):
        ink+=(1-i/histnum)*(len(hist[i])/highest)
    return ink+0.01

if __name__=='__main__':
    while True:
        n,w=map(int,input().split())
        if n==w==0:
            break
        V=[]
        for _ in range(n):
            heappush(V,int(input()))
        print(calcInk(w,V))




Fixed submission:
while 1:
    n,w=map(int,input().split())
    if n==w==0:break
    a=[0]*100
    s=h=int(0)
    while n:
        b=int(input())
        a[b//w]+=1
        s=max(s,b//w)
        h=max(h,a[b//w])
        n-=1
    ans=0.01
    for i in range(int(s)+1):
        ans+=a[i]/h*(s-i)/s
    print(ans)