아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

ASCII Art

시간 제한20초메모리 제한1024 MB

요약
알파벳을 두 번 반복해 출력하는 프로그램에서 N번째로 출력되는 글자를 구한다. N은 10^100까지 주어진다.
난이도

보통10점 중 4점

유형
수학, 이분 탐색
정답자
아직 제출이 없습니다

문제

Cody-Jamal has heard about generative artificial intelligence producing art. He is excited about the new art opportunities, but also worried about human-created art being displaced. He thought a good compromise would be to use computers to create art that humans simply cannot.

Since Cody-Jamal is just beginning at computer-generated art, he started simple. He wants to create an immense string that shows the English alphabet in a doubly-repeated way, to represent its ubiquity and permanence.

Cody-Jamal wrote the following program:

for i = 1 to 1e100:
  for letter = A to Z:
    print letter i times

Here 1e100 represents the integer 1010010^{100}. For example:

  • When i=1i=1, the program prints ABCD....XYZ.
  • When i=2i=2, the program prints AABBCC...XXYYZZ.
  • When i=3i=3, the program prints AAABBBCCC...XXXYYYZZZ.

Of course, Cody-Jamal's program takes a long time to finish. Can you help him know what the N\mathbf{N}-th printed letter will be without waiting for it to be printed?

입력

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 a single line with an integer N\mathbf{N}.

출력

For each test case, output one line containing Case #x: y, where xx is the test case number (starting from 1) and yy is the N\mathbf{N}-th character printed by Cody-Jamal's program.

제한

  • 1≤T≤1001 \le \mathbf{T} \le 100.

힌트

The first 3535 letters printed by Cody-Jamal's program are ABCDEFGHIJKLMNOPQRSTUVWXYZAABBCCDDE.... Therefore, the 55th printed character is E and the 3131st is C.

예제1

  1. 예제 1

    입력
    2
    5
    31
    
    예상 출력
    Case #1: E
    Case #2: C