Codeforces Beta Round 49 (Div. 2)
E
Dead Ends
Codeforces
2500
原题
← D→
翻译中…

Life in Bertown has become hard. The city has too many roads and the government spends too much to maintain them. There are $*n*$ junctions and $*m*$ two way roads, at which one can get from each junction to any other one. The mayor wants to close some roads so that the number of roads left totaled to $*n* - 1$ roads and it were still possible to get from each junction to any other one. Besides, the mayor is concerned with the number of dead ends which are the junctions from which only one road goes. There shouldn't be too many or too few junctions. Having discussed the problem, the mayor and his assistants decided that after the roads are closed, the road map should contain exactly $*k*$ dead ends. Your task is to count the number of different ways of closing the roads at which the following conditions are met:

翻译中…
  • There are exactly $*n* - 1$ roads left.
  • It is possible to get from each junction to any other one.
  • There are exactly $*k*$ dead ends on the resulting map.
翻译中…

Two ways are considered different if there is a road that is closed in the first way, and is open in the second one.

翻译中…

Input

翻译中…

The first line contains three integers $*n*$, $*m*$ and $*k*$ ($3 ≤ *n* ≤ 10, *n* - 1 ≤ *m* ≤ *n*·(*n* - 1) / 2, 2 ≤ *k* ≤ *n* - 1$) which represent the number of junctions, roads and dead ends correspondingly. Then follow $*m*$ lines each containing two different integers $*v*_{1}$ and $*v*_{2}$ ($1 ≤ *v*_{1}, *v*_{2} ≤ *n*, *v*_{1} ≠ *v*_{2}$) which represent the number of junctions connected by another road. There can be no more than one road between every pair of junctions. The junctions are numbered with integers from $1$ to $*n*$. It is guaranteed that it is possible to get from each junction to any other one along the original roads.

翻译中…

Output

翻译中…

Print a single number — the required number of ways.

翻译中…

样例

Input #1
3 3 2
1 2
2 3
1 3
Output #1
3
InputCopy OutputCopy
Input #2
4 6 2
1 2
2 3
3 4
4 1
1 3
2 4
Output #2
12
InputCopy OutputCopy
Input #3
4 6 3
1 2
2 3
3 4
4 1
1 3
2 4
Output #3
4
InputCopy OutputCopy
题目信息
题号
53E
时间限制
5 s
内存限制
256 MB
标签
位运算
动态规划

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。