Making Mexes

시간 제한2초메모리 제한2048 MB

문제

You are given an array $a$ of $N$ non-negative integers $a_1, a_2, \dots, a_N$ ($1\le N\le 2\cdot 10^5, 0\le a_i\le N$). In one operation, you can change any element of $a$ to any non-negative integer.

The mex of an array is the minimum non-negative integer that it does not contain. For each $i$ in the range $0$ to $N$ inclusive, compute the minimum number of operations you need in order to make the mex of $a$ equal $i$.

입력

The first line contains $N$.

The next line contains $a_1,a_2,\dots, a_N$.

출력

For each $i$ in the range $0$ to $N$, output the minimum number of operations for $i$ on a new line. Note that it is always possible to make the mex of $a$ equal to any $i$ in the range $0$ to $N$.