SP9510 ADSPROP - Ads Proposal
Description
There are **N** customers set their **M** different advertisements on Baidu. Each advertisement is owned by single customer. The ads system of Baidu records the number of clicks of each advertisement this year. The proposal system wants to analysis the advertisements about the relativity of the description length and the number of clicks of the advertisements. During the analysis, it is very important to do such a query to ask the total length of the advertisements with top **K** clicking times for each customer. You may assume the clicks of all advertisements are distinct.
Your task is to help Baidu to design this little toolkit.
Input Format
The input consist multiple test cases. The number of test cases is given in the first line of the input.
For each test case, the first line contains three integers **N**, **M** and **Q**, denoting the number customer, the number of advertisement instances and the number of queries. (**N**
Output Format
For each test case, output **Q** lines, each line contains only one integer, denoting the sum of total length of the top **K** number of clicks for each customer.