Simple Equations

0

0 votes
Implementation, Easy, Math
Problem

Adi Loves to play with Linear Equations.

One Day he came across a simple equation of the form2x+3y=z.  Given the value of z he simply wants to find the minimum sum of x+y such that x>=0 and y>=0 are integers.

 

Input Format:

In the first line you are given an integer t, number of test cases.

The next t lines contain an integer z.

 

Output Format:

Print the value of minimum sum x+y.

 

INPUT CONSTRAINTS

 Z  10^18

1  T  10^6

Sample Input
2
3 
4
Sample Output
1
2
Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

For the first test case x=0, y=1

For second test case x=2, y=0

Editor Image

?