Rock Climbing

Given n anchor points and a four-limb climbing model with pairwise distance and height limits, find the fewest moves to touch location n.

Medium6BFSGraphSimulationGeometryNo attempts yetTime limit2sMemory limit512 MB

Problem

A climbing wall, natural or man made, has small holes and protrusions where you can put your fingers or your toes. Reaching a target spot takes planning as much as strength, because before each move you have to know that some limb can go somewhere useful for the step after it.

This problem models that planning as follows. You are given nn locations on a two dimensional wall. One location takes one hand or one foot. In one move you put exactly one limb on another location, and these rules hold at every moment:

  • your two hands are at most 22 units apart, and your two feet are at most 22 units apart;
  • your left hand and your left foot are at most 33 units apart, and your right hand and your right foot are at most 33 units apart;
  • your left hand and your right foot are at most 44 units apart, and your right hand and your left foot are at most 44 units apart;
  • no two limbs are on the same location;
  • neither foot is higher than either hand, that is, the yy coordinate of each foot is at most the yy coordinate of each hand.

You start with your left foot on location 11, your right foot on location 22, your left hand on location 33, and your right hand on location 44. The starting position always obeys the rules. You have climbed the wall once any limb is on location nn. Find the smallest number of moves that puts a limb on location nn.

Input

The first line contains an integer KK with K1K \ge 1, the number of data sets. KK data sets follow, each in this form.

The first line of a data set contains one integer nn with 4n304 \le n \le 30, the number of locations. The next line contains 2n2n real numbers x1x_1, y1y_1, x2x_2, y2y_2, ..., xnx_n, yny_n, where (xi,yi)(x_i, y_i) is the position of location ii.

Output

For each data set, first print "Data Set x:" on a line of its own, where x is the number of the data set counted from 11. On the next line print the minimum number of moves until a limb first touches location nn. If no sequence of moves puts a limb on location nn, print Impossible on that line instead. Print a blank line after each data set.