2025-12-18 20:59:40 +09:00

20 lines
389 B
Python

import sys
input = sys.stdin.readline
MAX_NUM = 1000001
score = [0]*MAX_NUM
cards = [False]*MAX_NUM
nums = []
N = int(input())
for n in map(int, input().split()) :
nums.append(n)
cards[n] = True
for n in nums :
for i in range(n*2,MAX_NUM, n) :
if cards[i] :
score[n] += 1
score[i] -= 1
print(' '.join(map(str, list(score[n] for n in nums))))