For this Question: To seek revenge on Midgard, Loki devises a plan to torture the humans by making them take part in one of his silly games. He makes N people sit in a circle. He says he will kill every kth person sitting in the circle, starting from 1st person.
Loki performs his revenge prank until and unless 1 survivor remains.
What is the initial position of the survivor, if the indexing is clockwise?The first line of input contains a single integer T. The next T line of input contains Two space separated integers each containing value of N and k.


<b>Constraints:</b>
1 <= T <= 100
1 <= k, N <= 20Print the initial position of the survivor.Sample Input:
2
3 2
5 3

Sample Output
3
4

Explanation:
Test case 1: There are 3 people so skipping 1 person i.e 1st person 2nd person will be killed in next step 3rd person will be skipped and 1st person will be killed. Thus the safe position is 3.
Test case 2: 2 people i.e 1and 2 are skipped and person 3 will be killed in next step 4 and 5 will be skipped and 1st person will be killed next step 2 and 4 will be skipped and 5th person will be killed next step first 2 will be skipped then 4 will be skipped and so coming back to 2 therefore person 2 will be killed. Thus the safe position is 4., I have written this Solution Code: t=int(input())
while t>0:
	n,k=map(int,input().split())
	s=set()
	remove=0
	for i in range(1,n+1):
		s.add(i)
	i=1
	while True:
		if len(s)==1:
			break
		if i in s:
			remove+=1
		if remove==k:
			if i in s:
				s.remove(i)
				remove=0
		i+=1
		if i>n:
			i=1
	print(*s)
	t-=1, In this Programming Language: Python, Now tell me if this Code is compilable or not?