Fractional Lake
Kivi, Jam, Sap and AJ start their journey on finding a treasure hidden in the forbidden forest. They come across a lake which has a waterproof map at it's bottom. There are 2 glasses of capacity 3 litres and 5 litres. Since no one knows to swim here,they are forced to get all the water out of the lake in to a large pit nearby. But they can use only one of the glasses for completely emptying the lake. In each step, the glass chosen should be fully filled. They want to achieve the task in minimum number of steps. Help them in doing so, or print if its not possible.
Input:
First line contains an integer T denotes the number of test cases. Each of the following T lines contains a single integer n, the capacity of the lake in litres.
Output:
For each testcase,print "Yes" (without quotes) if it is possible to empty the lake. In the next line print the minimum number of times he needs to use one of the glasses to empty the lake. If it is not possible to empty the lake using 3 or 5 Litre glasses , print "No"(without quotes).
Constraints:
1 <= T <= 100
1 <= n <= 100000
Sample Input:
2
12
17
Sample Output:
Yes
4
No
Comments