#P8250. 交友问题
交友问题
Description
There are users on Luogu, and these users form an undirected network.
Luogu’s photo sharing rule is as follows: if user shares a photo with their friend , then all friends of can see this photo. User can also see this photo.
Now, user wants to share a photo, but they do not want user to see it. Without sending it to themselves, they want to know the maximum number of friends they can send it to.
Input Format
The first line contains three positive integers , representing the number of users, the number of edges, and the number of queries.
The next lines each contain two numbers , indicating that there is an undirected edge between users and .
The next lines each contain two numbers , indicating the -th query.
Output Format
For each query, output one line containing one number, the answer.
6 7 8
5 1
1 4
1 6
5 6
5 4
1 2
5 3
5 3
1 1
3 6
1 5
5 6
1 4
5 2
2 6
3
0
0
1
2
2
3
0
Hint
For of the testdata, , .
For of the testdata, , .
For of the testdata, , .
It is guaranteed that there are no multiple edges and no self-loops.
Translated by ChatGPT 5
京公网安备 11011102002149号