传统题 1000ms 256MiB

Building Point Pair

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

说明

Do you remember that when you first entered Fujian Normal University in your freshman year, the enthusiastic seniors and sisters gave you a gift package for the start of school. There is a map in the gift package. On the map, there are nn teaching buildings on the map. They are connected by mm undirected roads, the distance of each road is 11.

Now You are given two integers a,ba, b which refers two special teaching buildings. Please find the total number of pairs (u,v)(u,v) of the teaching buildings to satisfy : Every path from uu to vv must go through two special teaching buildings aa and bb.

输入格式

The first line contains four integers n,m,a,bn,m,a,b (4nm105,1a,bn,ab)(4 \leq n \leq m \leq 10^5, 1 \leq a,b \leq n,a \neq b).

The next mm lines contains two integers u,vu,v (1u,vn,uv)(1\leq u,v \leq n, u \neq v), represent an edge between building uu and vv.

输出格式

Print the total number of pairs that meets the conditions.

样例

样例输入 1

7 7 2 3
1 2
2 3
3 4
4 5
5 6
4 6
2 7

样例输出 1

6

福建师范大学第十八届程序设计竞赛正式赛

未参加
状态
已结束
规则
IOI
题目
10
开始于
2022-4-25 8:00
结束于
2023-3-24 16:00
持续时间
8000 小时
主持人
参赛人数
15