from collections import Counter n = int(input()) f = Counter(map(int,input().split())).values() a = [0]*(n+1) ile=0 for v in f: k = 1 while k<=v: a[k] += v//k*k k += 1 ile +=1 print(' '.join(map(str,a[1:])))
1 2 3 4 5 6 7 8 9 10 11 12 | from collections import Counter n = int(input()) f = Counter(map(int,input().split())).values() a = [0]*(n+1) ile=0 for v in f: k = 1 while k<=v: a[k] += v//k*k k += 1 ile +=1 print(' '.join(map(str,a[1:]))) |