题号:NC222749
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld
题目描述
Sichuan hotpot is one of the most famous dishes around the world. People love its spicy taste.
There are

tourists, numbered from

to
%7D)
, sitting around a hotpot. There are

types of ingredients for the hotpot in total and the i-th tourist favors ingredient

most. Initially, every tourist has a happiness value of

and the pot is empty.
The tourists will perform m moves one after another, where the

-th (numbered from

to (m - 1)) move is performed by tourist
%7D)
. When tourist

moves:
- If ingredient
exists in the pot, he will eat them all and gain
happiness value. - Otherwise, he will put one unit of ingredient
into the pot. His happiness value remains unchanged.
Your task is to calculate the happiness value for each tourist after

moves.
输入描述:
There are multiple test cases. The first line of the input contains an integer
(
) indicating the number of test cases. For each test case:
The first line contains three integers
,
and
(
,
,
) indicating the number of tourists, the number of types of ingredients and the number of moves.
The second line contains
integers
(
) where
indicates the favorite ingredient of tourist
.
It's guaranteed that neither the sum of
nor the sum of
of all the test cases will exceed
.
输出描述:
For each test case output
integers
in one line separated by a space, where
indicates the happiness value of tourist i after m moves.
Please, DO NOT output extra spaces at the end of each line, or your answer might be considered incorrect!
示例1
输入
复制
4
3 2 6
1 1 2
1 1 5
1
2 2 10
1 2
2 2 10
1 1
说明
The first sample test case is explained as follows.