logo AlgoBeat OnlineJudge
登录 注册

#216734. [GKS 2019 #H] H-index

内存限制:1024 MiB 时间限制:5000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

It is important for researchers to write many high quality academic papers. Jorge has recently discovered a way to measure how impactful a researcher's papers are: the H-index.

The -index score of a researcher is the largest integer such that the researcher has papers with at least citations each.

Jorge has written papers in his lifetime. The i-th paper has citations. The number of citations that each paper has will never change after it is written. Please help Jorge determine his H-index score after each paper he wrote.

输入格式

The first line of the input gives the number of test cases, . test cases follow. Each test case begins with a line containing , the number of papers Jorge wrote.

The second line contains integers. The i-th integer is , the number of citations the i-th paper has.

输出格式

For each test case, output one line containing Case #x: y, where x is the test case number (starting from 1) and y is a space-separated list of integers. The i-th integer is the H-index score after Jorge wrote his i-th paper.

样例

样例输入 1

2
3
5 1 2
6
1 3 3 2 2 15

样例输出 1

Case #1: 1 1 2
Case #2: 1 1 2 2 2 3

数据范围与提示

In Sample Case #1, Jorge wrote papers.

  • After the 1st paper, Jorge's H-index score is , since he has paper with at least citation.
  • After the 2nd paper, Jorge's H-index score is still .
  • After the 3rd paper, Jorge's H-index score is , since he has papers with at least citations (the 1st and 3rd papers).

In Sample Case #2, Jorge wrote papers.

  • After the 1st paper, Jorge's H-index score is , since he has paper with at least citation.
  • After the 2nd paper, Jorge's H-index score is still .
  • After the 3rd paper, Jorge's H-index score is , since he has papers with at least citations (the 2nd and 3rd papers).
  • After the 4th paper, Jorge's H-index score is still .
  • After the 5th paper, Jorge's H-index score is still .
  • After the 6th paper, Jorge's H-index score is , since he has papers with at least citations (the 2nd, 3rd and 6th papers).

Limits

.

.

Test set 1 (Visible)

.

Test set 2 (Hidden)

.