There are n houses in a village named Lonere. A Corona pandemic broke out in the village and people are asked to not come out of their houses to avoid further spread. Meena is the head of this village. He suspects that some people might not follow his rules so he comes out with a plan. Meena decides to construct k rivers of infinite length such that any two houses are isolated from each other. Two houses being isolated means you cannot go from one house to another without crossing a river.
Two or more rivers can intersect at a point but a river cannot intersect itself. The rivers need not be necessarily straight (they can be curved any number of times)
He wants to be as efficient as possible, so he comes to you for help. Can you find the minimum possible k, such that k rivers can isolate n houses in the above stated manner.
Note that the houses do not form any kind of order, they are arbitrarily placed in the village and the rivers need not be necessarily straight (they can be curved any number of times).
Scanner sc=new Scanner(System.in);
int t = sc.nextInt();
int n = sc.nextInt();
int ans = 2;
if(n==1) ans = 0;
else if(n==2) ans = 1;
for _ in range(t):