PROGRAMMING:War map( Adjacency matrix (version)
Due to the betrayal of the traitor Zhu Ziming, the independent regiment's headquarters in zhaojiayu was almost destroyed on the day of Li Yunlong's wedding.
After the siege, Li Yunlong decided to gather all the troops stationed outside to attack Ping'an County with heavy weapons and Italian guns!
After the news passes through the regiment headquarters and arrives at the headquarters of each department, the resident commander will send his own communication personnel to inform other troops. But once the station is captured, the station can't receive orders. Similarly, the station with road connection can't receive orders!
Now, Li Yunlong wants to know that if a station is captured, all stations will be divided into several connected blocks!
In order to simplify the problem, we don't need to calculate the specific information of each connected block, only need to output the number of connected blocks!
###Input format:
The first line contains two positive integers n (n < = 1000) and m (< = 2000), indicating that there are n stations in the whole theater, which are connected by M undirected paths( Stations (numbered from 1 to n)
Next, line m, each line contains two station numbers, which means that there is a path between the two stations!
The next line contains a positive integer Q, which means there are Q queries!
Next, Q lines, each line contains a resident number!
###Output format:
For each query, please output the number of connected blocks formed by the station of this theater after deleting it and all the connected paths!
It is worth noting that each inquiry is independent of each other!
###Input example:
Here is a set of inputs. For example:
```in
8 8
1 2
1 4
2 3
4 3
3 5
5 7
5 6
5 8
three
three
five
seven
```
###Output example:
The corresponding output is given here. For example:
```out
two
four
one
```
answer:If there is no answer, please comment
After the siege, Li Yunlong decided to gather all the troops stationed outside to attack Ping'an County with heavy weapons and Italian guns!
After the news passes through the regiment headquarters and arrives at the headquarters of each department, the resident commander will send his own communication personnel to inform other troops. But once the station is captured, the station can't receive orders. Similarly, the station with road connection can't receive orders!
Now, Li Yunlong wants to know that if a station is captured, all stations will be divided into several connected blocks!
In order to simplify the problem, we don't need to calculate the specific information of each connected block, only need to output the number of connected blocks!
###Input format:
The first line contains two positive integers n (n < = 1000) and m (< = 2000), indicating that there are n stations in the whole theater, which are connected by M undirected paths( Stations (numbered from 1 to n)
Next, line m, each line contains two station numbers, which means that there is a path between the two stations!
The next line contains a positive integer Q, which means there are Q queries!
Next, Q lines, each line contains a resident number!
###Output format:
For each query, please output the number of connected blocks formed by the station of this theater after deleting it and all the connected paths!
It is worth noting that each inquiry is independent of each other!
###Input example:
Here is a set of inputs. For example:
```in
8 8
1 2
1 4
2 3
4 3
3 5
5 7
5 6
5 8
three
three
five
seven
```
###Output example:
The corresponding output is given here. For example:
```out
two
four
one
```
answer:If there is no answer, please comment