Rohan and Madhav are playing a Mind game in which Rohan chooses a Number N (Integer)between 1 To 10 in his mind and Madhav has no idea about the chosen number.

Rohan is asked to perform the following operations on chosen number by Madhav.

Step 1:Double the chosen number.

Step 2:Add a number k(even number given as input) to the number obtained after Step1

Step 3:Divide the obtained number in Step 2 by 2.

Step 4:Now subtract the obtained number in Step 3 with the original chosen number N

Madhav's task is to find the answer obtained at the end of Step 4 ,i.e,at the end of all the mentioned operations performed on the number chosen by Rohan.

Help Madhav to find the answer.

**Input:**

The first line of input contains an integer denoting the number of test cases . Next line of input contains a positive even number K which is to be used in step 2.

**Output:**

For each test case , the output is in a new line containg an integer which is the required answer at the end of Step 4.

**Constraints:**

1<=T<=100

2<=K<=1000

K is always even

**Example:**

**Input :**

1

10

**Output:**

5

Suppose rohan choses 3 then after

Step 1:number=6

Step 2:number=6+10=16

Step 3:number=16/2=8

Step 4=8-3=5(required answer).

**Example:**

**Input : **

2

4

12

**Output : **

2

6

Author: Riya Bhardwaj

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

vkpm | 22 |

Phenix_Fire | 18 |

shubhangi_upasani | 18 |

sajnanair | 16 |

EshaAgarwal | 16 |

Pulkit__Sharma__ | 806 |

Anirban166 | 682 |

Found_me | 616 |

abducodes | 607 |

Sathvik Avasarala | 518 |

blackshadows | 5331 |

Ibrahim Nash | 5219 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4559 |

Login to report an issue on this page.