QOJ.ac

QOJ

Límite de tiempo: 2.0 s Límite de memoria: 256 MB Puntuación total: 100

#11812. 天选之人

Estadísticas

这里有一则突发新闻。现在你有机会通过一场游戏与亚洲区总监单独会面。

所有追逐梦想的男孩和女孩都必须排成一列。他们按照站立的顺序从 1 开始编号。

主持人随后会进行多轮游戏,每一轮都会移除所有站在奇数位置上的男孩和女孩。

例如,如果总共有 $n = 8$ 名男孩和女孩。最初站立的人编号为 1, 2, 3, 4, 5, 6, 7 和 8。第一轮结束后,剩下的人是 2, 4, 6 和 8。第二轮结束后,只剩下两个人,即 4 和 8。

坚持到最后的人就是“天选之子”。

我知道你想成为那个能与偶像单独会面的“天选之子”。给定男孩和女孩的总数,你能找到排在队伍中的最佳位置,从而成为“天选之子”吗?

输入格式

输入的第一行包含测试用例的数量 $t$ ($1 \le t \le 1000$)。

接下来的 $t$ 行,每行包含一个整数 $n$,表示男孩和女孩的总数,其中 $2 \le n \le 10^{50}$。

输出格式

输出显示 $t$ 行,每行包含一个整数,表示你为了赢得机会应该站立的位置。

样例

输入格式 1

4
5
12
23
35

输出格式 1

4
8
16
32

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.