# Learning BFS 2

Given N vertices and M edges of a

**Directed Graph**.

Find the minimum distance from Source(S) to Destination(D).

If it is not Reachable display -1.

**Input**

First Line contains single integer t containing number of test cases that follow.

First Line of each test case consists of 2 integers N and M denoting the number of vertices and number of edges respectively.

Second Line contains two integers Source(S) and Destination(D).

Next M lines each containing 2 elements u and v denoting there is an edge from u to v.

**Output**

T lines , one line for each test case containing a single Integer that gives minimum distance required to reach D from S.

If it is unreachable output -1.

**Constraint**

0 < N < 25

0 <= S,D,u,v < N

**Sample Input**

```
```

3

4 4

2 3

0 2

1 2

3 1

3 2

4 3

3 2

0 2

1 2

3 1

6 9

4 3

1 0

1 2

1 5

2 0

2 5

4 0

4 2

5 0

5 3

**Sample Output**

```
```

-1

2

3

**PS: Apply BFS :P***Problem Setter : Arjun Singh Bhatia*

*Problem Tester : Dhruva Bhaswar*

**Languages:**Brain,C,C++,Java,Pascal,Perl,PHP,Python,Ruby,Text