Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Dinner With Aminvai

By Tareq_Abrar · Limits 1s, 512 MB

Aminvai is a famous programmer of the world. He has a lot of fans & followers. Unfortunately, he has no enough time for talking to all of his fans and followers. Recently, his PA has announced an offer. They who will be able to solve this problem, may get the opportunity to have dinner with Aminvai on 29th February 2021.

In this problem, you'll be given a number. You have to add 4 with the given number. Then multiply the new number with 2. Subtract 8 from the last number you got. Now, divide this number by 2 and output the quotient you got.

Input

There are several test cases. The first line of input contains a positive integer TT ( 1T1001 \le T \le 100), which denotes the number of test cases. In each line of next TT lines, there will be given a number XX (101000X101000-10^{1000} \le X \le 10^{1000} ).

Output

Output will contain TT lines. In each line, you have to print a number which denotes the answer for the consecutive test case.

Sample

InputOutput
2
5
0
5
0

5+4=95 + 4 = 9

9×2=189 \times 2 = 18

188=1018 - 8 = 10

10÷2=510 \div 2 = 5.


Discussion

Statistics


77% Solution Ratio

BrehamPieEarliest, May '20

BrehamPieFastest, 0.0s

BrehamPieLightest, 131 kB

anonyo.akandShortest, 39B

Submit

Login to submit

Editorial

Happy Coding!!

Related Contests

Toph uses cookies. By continuing you agree to our Cookie Policy.