Doctor and Coins

0

0 votes
Very-Easy
Problem

The Doctor needs some stuff for his next adventure. He is currently on an alien planet and doesn't have any currency of that planet. But, he has a valuable gem that he found few days back on a planet when he was on his last adventure. The gem has some value N. He can get some coins with value 2 and some with 3 in exchange of the gem. Also, the sum of values of the coins will be equal to the value of the gem. Also, he wants to have maximum number of 3 valued coins as he'll have to carry less number of coins.Your task is to calculate the maximum number of 3 valued coins that he can get.

Input Format:

First line consists of T, number of test cases.

Each of the next T lines consists of a number N.

Output Format:

For each test case, print the maximum number of 3 values coins possible.

Constraints:

1T105

2N109

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

For the first case, only possible combination is one 2 valued coin. Hence, 0 is the answer.

For second case, two 3 valued coins can be obtained in exchange of 6 valued gem.

Editor Image

?