|All-time Popular Problems|
|Inorder Successor in BST|
|Maximum Product Subarray|
|Is Binary Number Multiple of 3|
|Pairwise swap elements of a linked list by swapping data|
|Largest Number formed from an Array|
|Reverse an Array|
|Boundary Traversal of binary tree|
|Leaders in an array|
Given a number n, count minimum steps to minimise it to 1 according to the following criteria:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. The first line of each test case contains an integer N denoting the number n.
Output the minimum steps to minimise the number in a new line for each test case.
1<= T <=1000
1<= N <=10000