logo AlgoBeat OnlineJudge
登录 注册

#216537. [GKS 2015 #A] Googol String

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

题目描述

A "0/1 string" is a string in which every character is either 0 or 1. There are two operations that can be performed on a 0/1 string:

  • switch: Every 0 becomes 1 and every 1 becomes 0. For example, "100" becomes "011".
  • reverse: The string is reversed. For example, "100" becomes "001".

Consider this infinite sequence of 0/1 strings:

...

.

You need to figure out the Kth character of , where googol = .

输入格式

The first line of the input gives the number of test cases, . Each of the next lines contains a number .

输出格式

For each test case, output one line containing "Case #x: ", where is the test case number (starting from ) and is the Kth character of .

样例

样例输入 1

4
1
2
3
10

样例输出 1

Case #1: 0
Case #2: 0
Case #3: 1
Case #4: 0

数据范围与提示

Limits

.

Small dataset (Test Set 1 - Visible)

.

Large dataset (Test Set 2 - Hidden)

.