Students and Mentors

아직 제출이 없습니다메모리 제한1024 MB

문제

A group of N\mathbf{N} students prepares together for upcoming programming competitions such as Kick Start and Code Jam by Google. To help each other prepare, it was decided that each student will pick a mentor among other students. A mentor will help their mentee to solve problems, learn algorithms, track their progress, and will generally support them throughout preparation.

Each student will have exactly one mentor among all other students, and a person can be a mentor to multiple people. For every student ii we know their rating R_i\mathbf{R\_i} which approximates how good that student is at programming competitions. Because it is believed that a mentor should not be much stronger than their mentee, a student jj can be a mentor of student ii only if R_j2×R_i\mathbf{R\_j} \le 2 \times \mathbf{R\_i}. Note that a mentor can even have a rating that is lower or equal to their mentee's rating.

Unsurprisingly, each student wants to have the strongest possible mentor. For each student, can you help to figure out what is the highest possible rating of a mentor they can pick?

입력

The first line of the input gives the number of test cases, T\mathbf{T}. T\mathbf{T} test cases follow. Each test case consists of two lines.

The first line of each test case contains an integer N\mathbf{N}, representing the number of students in a group.

The second line of each test case contains N\mathbf{N} integers R_1 R_2 R_3  R_N\mathbf{R\_1} \ \mathbf{R\_2} \ \mathbf{R\_3} \ \dots \ \mathbf{R\_N} where R_i\mathbf{R\_i} is a rating of the ii-th student.

출력

For each test case, output one line containing Case #x: M1 M2 M3 ... MN$ where xx is the test case number (starting from 1), and M_iM\_i is the maximum possible rating of the ii-th student's mentor or 1-1 if there are no suitable mentors for that student.

제한

  • 1T1001 \le \mathbf{T} \le 100.
  • 1R_i1061 \le \mathbf{R\_i} \le 10^6, for all ii.