最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

CF 1651A - Playoff

2023-06-22 08:58 作者:您是打尖兒還是住店呢  | 我要投稿

Consider a playoff tournament where 2n athletes compete. The athletes are numbered from 1 to 2n.

The tournament is held in n

?stages. In each stage, the athletes are split into pairs in such a way that each athlete belongs exactly to one pair. In each pair, the athletes compete against each other, and exactly one of them wins. The winner of each pair advances to the next stage, the athlete who was defeated gets eliminated from the tournament.


The pairs are formed as follows:


in the first stage, athlete 1 competes against athlete 2; 3 competes against 4; 5 competes against 6, and so on;

in the second stage, the winner of the match "1–2" competes against the winner of the match "3–4"; the winner of the match "5–6" competes against the winner of the match "7–8", and so on;

the next stages are held according to the same rules.

When athletes x and y compete, the winner is decided as follows:

if x+y is odd, the athlete with the lower index wins (i.?e. if x<y, then x wins, otherwise y wins);

if x+y is even, the athlete with the higher index wins.The following picture describes the way the tournament with n=3 goes.

Your task is the following one: given the integer n, determine the index of the athlete who wins the tournament.


Input

The first line contains one integer t (1≤t≤30) — the number of test cases.

Each test case consists of one line containing one integer n (1≤n≤30).

Output

For each test case, print one integer — the index of the winner of the tournament.

Example

input

2

3

1

output

7

1

Note

The case n=3 is shown in the picture from the statement.

If n=1, then there's only one match between athletes 1 and 2. Since 1+2=3

?is an odd number, the athlete with the lower index wins. So, the athlete 1 is the winner.


永遠(yuǎn)是2的n次方-1那個(gè)人最后獲得勝利。

下面是代碼:


CF 1651A - Playoff的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
团风县| 长汀县| 德惠市| 出国| 旌德县| 奇台县| 昭觉县| 青田县| 澄迈县| 东乡县| 防城港市| 崇阳县| 巴中市| 通许县| 洪洞县| 理塘县| 沂南县| 翁源县| 珲春市| 江阴市| 江山市| 南汇区| 沈阳市| 满城县| 五家渠市| 墨竹工卡县| 休宁县| 珲春市| 台山市| 宁晋县| 蒲城县| 齐齐哈尔市| 舒兰市| 广河县| 青川县| 肃南| 施秉县| 长白| 县级市| 观塘区| 武穴市|