| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 50 초 (추가 시간 없음) | 1024 MB | 104 | 67 | 48 | 70.588% |
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 H-index score of a researcher is the largest integer h such that the researcher has h papers with at least h citations each.
Jorge has written N papers in his lifetime. The i-th paper has Ai 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, T. T test cases follow. Each test case begins with a line containing N, the number of papers Jorge wrote.
The second line contains N integers. The i-th integer is Ai, 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.
2 3 5 1 2 6 1 3 3 2 2 15
Case #1: 1 1 2 Case #2: 1 1 2 2 2 3
In Sample Case #1, Jorge wrote N = 3 papers.
In Sample Case #2, Jorge wrote N = 6 papers.
Contest > Google > Kick Start > Google Kick Start 2019 > Round H A번