There is a tree of N nodes and a integer k.In one operation you can do the following . Choose a node X other than the root node. If the distance between root and the parent of X is less than that of X ( where 1<=X<=N ) . Then X will be disconnected from it's original parent and X will be directly get connected to root. Height of the tree is the maximum distance from root to any node of tree . So find the minimum height of the tree after applying the above operation at most K times