Given an undirected graph and an edge, the task is to find if the given edge is a bridge in graph, i.e., removing the edge disconnects the graph.

**Input:**

The first line of the input contains an integer **'T'** denoting the number of test cases. Then **'T'** test cases follow. Each test case consists of two lines.

Description of test cases is as follows:

The First line of each test case contains two integers **'N' and 'M' ** which denotes the no of vertices and no of edges respectively.

The Second line of each test case contains **'M' ** space separated pairs **u** and **v** denoting that there is a bidirectional edge from **u** to **v**

The third line contains two space seperated integers denoting the edge to be removed.

**Output:**

For each test case ouput a single line 1 or 0, 1 if edge is a Bridge edge or not.

**Constraints:**

1<=T<=50

1<=N,M<=100

**Example:**

**Input:**

2

4 3

0 1 1 2 2 3

1 2

5 5

1 2 2 0 1 0 3 4 3 0

2 0

**Ouput:**

1

0

**Note:**The **Input/Ouput** format and **Example** given are used for system's internal purpose, and should be used by a user for **Expected Output** only. As it is a function problem, hence a user should not read any input from stdin/console. The task is to complete the function specified, and not to write the full code.

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

d_Coder00 | 134 |

dungeon_master1299 | 126 |

Astikeysingh | 120 |

rajendrashekhawat063 | 115 |

kaustavbhattachaarya | 111 |

Pulkit__Sharma__ | 646 |

Anirban166 | 531 |

abducodes | 501 |

Found_me | 454 |

Yo_Nehru | 404 |

blackshadows | 5331 |

Ibrahim Nash | 5219 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4559 |

Login to report an issue on this page.