CF53E.Dead Ends

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Life in Bertown has become hard. The city has too many roads and the government spends too much to maintain them. There are nn junctions and mm 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 n1n-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 kk 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 n1n-1 roads left.
  • It is possible to get from each junction to any other one.
  • There are exactly kk 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.

输入格式

The first line contains three integers nn , mm and kk ( 3<=n<=10,n1<=m<=n(n1)/2,2<=k<=n13<=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 mm lines each containing two different integers v1v_{1} and v2v_{2} ( 1<=v1,v2<=n,v1v21<=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 11 to nn . It is guaranteed that it is possible to get from each junction to any other one along the original roads.

输出格式

Print a single number — the required number of ways.

输入输出样例

  • 输入#1

    3 3 2
    1 2
    2 3
    1 3
    

    输出#1

    3
    
  • 输入#2

    4 6 2
    1 2
    2 3
    3 4
    4 1
    1 3
    2 4
    

    输出#2

    12
    
  • 输入#3

    4 6 3
    1 2
    2 3
    3 4
    4 1
    1 3
    2 4
    

    输出#3

    4
    
首页