Indoorienteering
Lukáš really likes orienteering, a sport that requires locating control points in rough terrain. To entertain the NWERC participants Lukáš wants to organize an orienteering race. However, it would be too harsh for the participants to be outdoors in this cold Swedish November weather, so he decided to jump on the new trend of indoor races, and set the race inside the B building of Linköping University.
Lukáš has already decided on the locations of the control points. He has also decided on the exact length of the race, so the only thing remaining is to decide in which order the control points should be visited such that the length of the total race is as he wishes. Because this is not always possible, he asks you to write a program to help him.
Input
Consists of:
one line with two integers n (2 ≤ n ≤ 14) and L (1 ≤ L ≤
10^15
), the number of control points and the desired length of the race, respectively;n lines with n integers each. The j-th integer on the i-th line,
d[ij]
, denotes the distance between control point i and j (1 ≤d[ij]
≤ L for i ≠ j, andd[ii]
= 0). For all 1 ≤ i, j, k ≤ n it is the case thatd[ij]
=d[ji]
andd[ij]
≤d[ik]
+d[kj]
.
Output
Output one line with "possible" if it is possible to visit all control points once in some order and directly return to the first one such that the total distance is exactly L, and "impossible" otherwise.