Time limit: 1 second Memory limit: 256 MB After more than two years of waiting and…
- User
Time limit: 1 second Memory limit: 256 MB After more than two years of waiting and searching for a teammate, Abu Ishaq found out that CodeCup 5 will be held individually! That's why he was upset and his thoughts became a graph! Now it's up to you to get it back to normal.
Abu Ishaq's string of thoughts is a simple connected graph n n Rasi and m m is an edge. He decides to restore his train of thought during k k steps, each step adds an edge to it so that the resulting graph remains simple and has at least one cycle of odd length. (a simple graph is a graph that does not have multiple edges or rings)
But he, whose mental health is very important to him, asks you to tell him the number of different ways to do this before he starts working. Since the number of states may be very large, the remainder of its division by 1 0 9 + 7 10 9 Tell him +7 (two ways of doing k k stages are called distinct, if a stage like i (i) that the two ends of the edges added in the first method are not equal to the two ends of the edges added in the second method).
Pay attention to the order of adding k k edge is important.
input In the first line, enter three numbers n n, m m and k k has arrived. in m m the next line of two numbers v v and u u is present, indicating an edge between vertices v v and u There is u.
3 ≤ n ≤ 1
000 3≤n≤1 000 n
1 ≤ m < ( n 2 ) n−1≤m<( 2 n ) 1 ≤ v , u ≤ n 1≤v,u≤n m + k ≤ ( n 2 ) m+k≤( 2 n ) 1 ≤ k 1≤k
It is guaranteed that the input graph is connected and simple.
output The output should show the remaining number of requested methods 1 0 9 + 7 10 9 Print +7.
Example Sample entry 1 4 3 2 1 2 2 3 3 4 Plain text Sample output 1 6 Plain text Example description Sample input 2 3 2 1 1 2 1 3 Plain text Sample output 2 1 Plain text You can only mane ( 2 , 3 ) (2,3) added. write in java17
- Assistant