Question one hundred and thirty-three: Not easy Series II

Source: Internet
Author: User

Description


You are not easy to live, I am not easy to live, and he is not easy to live. However, if you read the following story, you will know that it is not easier to have an old man than you.


Xu Lahan (Grand Xu Donghai, referred to as XDH) in huangmuban village, a suburb of Chongqing, has worked hard to raise many sheep over the past two years. This summer, due to the well-known high temperature and drought, there is no way to solve the drinking water problem of livestock, so we decided to sell all these sheep to the market. From the village of Huangpi board to the place where the transaction will go through N toll stations, it is said that this toll station has nothing to do with Xu Lahan, but the fact is that Xu Lahan wants to cry:


(Lens playback)


Close view: Lahan, a group of Sheep
Vision: roads and toll stations


......


Toll collector (Polite + Professional smile): "old comrade, please pay the toll !"


Xu Lahan: "pot, pot-furnace-fee? Isn't my house a boiler ?"


Toll collector (Professional smile still): "old comrade, I am talking about the road-fee, that is, your goat must pay for this intersection, understand ?"


Xu Lahan (close to the camera for 10 seconds, his mouth open): "I-I know that the car is going to be charged when it passes the road. Will this goat be charged ?"


Toll collectors: "Why don't you understand old comrade? How many wheels are there ?"


Xu Lahan (relaxed): "I know. Today, my grandson asked me this question at home. There are four !"


Toll collector (angry, standing up): "Hey! Old man, you still swear without dirty words. Since you know the four wheels of a car, don't you know how many legs this goat has ?!"


Xu Lahan (embarrassed, still puzzled): "also, there are also four. Does this matter ?"


Toll collector (angry, standing up): "why is it okay! As we said, all four legs will be charged !"


......


(Voiceover)


Because Xu Lahan had no money, the toll collector took his goat in half. When he saw the old man's tears, he hesitated and gave it back to the old man. Coincidentally, every time a toll station was behind, it took half of the goat at that time, and then refunded one. When the old man arrived at the market, there were only three sheep left.


If you are a young man with conscience, how many lambs did the old man have?


Input


The first line of the input data is an integer N, indicating the number of test data groups. The following consists of N rows. Each row contains an integer a (0 <a <= 30 ), the number of toll stations.


Output


For each test instance, please output the initial number of sheep, each test instance output occupies one line.


Sample Input

 


2
1
2

 


Sample Output

 


4

6

 

 

[Plain] # include <stdio. h>
 
Int main ()
{
Int I;
Int n;
Int m;
Int sum;
Int num;
 
Scanf ("% d", & n );
 
While (n --)
{
Scanf ("% d", & num );

M = 3;
For (I = 1; I <= num; I ++)
{
Sum = (m-1) * 2;
M = sum;
}
 
Printf ("% d", sum );
 
If (n> 0)
{
Printf ("\ n ");
}
}
 
 
Return 0;
}

# Include <stdio. h>

Int main ()
{
Int I;
Int n;
Int m;
Int sum;
Int num;

Scanf ("% d", & n );

While (n --)
{
Scanf ("% d", & num );

M = 3;
For (I = 1; I <= num; I ++)
{
Sum = (m-1) * 2;
M = sum;
}

Printf ("% d", sum );

If (n> 0)
{
Printf ("\ n ");
}
}


Return 0;
}
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.