human
Solve in Python:
Problem Statement:Captain America and Iron Man are at WAR and the rage inside Iron Man is rising.

But Iron Man faces a problem to identify the location of Captain America.

There are N buildings situtaed adjacently to each other and Captain America can be at any building.

Iron Man has to arrange the Buildings from 1 to N is such a way that Value(i.e abs(Building Number -Position of Building))=K for every building.

Can You help Iron Man to Find The Arrangement of the Buildings?

P.S- If no arrangement exist, then print         
“CAPTAIN AMERICA EVADES”.

Input Format:
The first line of input contains a single integer,T, denoting the number of test cases.

Each of the T  subsequent lines contains 2 space-separated integers describing the respective N and K values for a test case.

Output Format:
On a new line for each test case, 

Print the lexicographically smallest arrangement.

If no absolute arrangement exists, print “CAPTAIN AMERICA EVADES”.

Constraints:
SubTask#1
1<=T<=10

1<=N<=10^5

0<=K<=N

SubTask#2
Original Constraints..

SubTask#3
Original Constraints..

Sample Input:
3

2 1

3 0

3 2

Sample Output:

2 1

1 2 3

CAPTAIN AMERICA EVADES

Explanation:
Case 1:

N=2 and K=1

Therefore the arrangement is [2,1].

Case 2:

N=3 and K=0

Therefore arrangement is [1,2,3].
assistant
#Here is Python program to find The Arrangement of the Buildings.

t = int(input())
while t> 0:
 t =t -1
 n,k = list(map(int,input().split()))
 a = [0]*n
 done = True

 def swap(z):
  for j in range(0,n):
   if a[j] == 0:
    a[j] = z
    done = True
    break
   else:
    if a[j] > z:
     swap(j)
     a[j] = z
    else:
     done = False
     break

 for i in range(0,n):
  for j in range(0,n):
   if abs(i-j) == k:
    if a[j] == 0:
     a[j] = i + 1
     done = True
     break
    else:
     if a[j] > i + 1:
      swap(a[j])
      a[j] = i + 1
     else:
      done = False

 if 0 in a:
  print('CAPTAIN AMERICA EVADES')
 else:
  if done:
   for c in a:
    print(c, end=' ')
   print()
  else:
   print('CAPTAIN AMERICA EVADES')

 # for i in range(1,n+1):
 #   if i - k >=0 :
 #       if a[abs(i-k-1)] == 0:
 #           a[abs(i-k-1)] = i
 #           done = True
 #       else:
 #           done = False
 #           break
 #   else:
 #       done = False
 #       break
 # if done:
 #   for c in a:
 #       print c,
 #   print
 # else:
 #   print "CAPTAIN AMERICA EVADES"