Hotpot
题号: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 , 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 . When tourist moves:
  • If ingredient a_t exists in the pot, he will eat them all and gain happiness value.
  • Otherwise, he will put one unit of ingredient a_t 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 a_i 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 h_i 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

输出

复制
0 2 1
2
2 2
0 5

说明

The first sample test case is explained as follows.