{"raw_statement":[{"iden":"problem statement","content":"You are given a sequence $A = (A_1, A_2, \\ldots, A_N)$ of length $N$. For each $K = 0, 1, 2, \\ldots, N-1$, solve the following problem.\n\n> Find the number of integers $i$ between $1$ and $N$ (inclusive) such that:\n> \n> *   $A$ contains exactly $K$ distinct integers greater than $A_i$."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 2 \\times 10^5$\n*   $1 \\leq A_i \\leq 10^9$\n*   All values in the input are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $\\ldots$ $A_N$"},{"iden":"sample input 1","content":"6\n2 7 1 8 2 8"},{"iden":"sample output 1","content":"2\n1\n2\n1\n0\n0\n\nFor example, we will find the answer for $K=2$.\n\n*   Regarding $A_1 = 2$, $A$ contains $2$ distinct integers greater than $A_1$: $7$ and $8$.\n*   Regarding $A_2 = 7$, $A$ contains $1$ distinct integer greater than $A_2$: $8$.\n*   Regarding $A_3 = 1$, $A$ contains $3$ distinct integers greater than $A_3$: $2, 7$, and $8$.\n*   Regarding $A_4 = 8$, $A$ contains $0$ distinct integers greater than $A_4$ (there is no such integer).\n*   Regarding $A_5 = 2$, $A$ contains $2$ distinct integers greater than $A_5$: $7$ and $8$.\n*   Regarding $A_6 = 8$, $A$ contains $0$ distinct integers greater than $A_6$ (there is no such integer).\n\nThus, there are two $i$'s, $i = 1$ and $i = 5$, such that $A$ contains exactly $K = 2$ distinct integers greater than $A_i$. Therefore, the answer for $K = 2$ is $2$."},{"iden":"sample input 2","content":"1\n1"},{"iden":"sample output 2","content":"1"},{"iden":"sample input 3","content":"10\n979861204 57882493 979861204 447672230 644706927 710511029 763027379 710511029 447672230 136397527"},{"iden":"sample output 3","content":"2\n1\n2\n1\n2\n1\n1\n0\n0\n0"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}