//*** Author: ShlokG ***// // #pragma GCC optimize("Ofast") // #pragma GCC target("avx,avx2,fma") // #pragma GCC optimization ("unroll-loops") #include #include #include using namespace std; using namespace __gnu_pbds; #define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); template using ordered_set = tree, rb_tree_tag, tree_order_statistics_node_update>; // find_by_order(k) returns iterator to kth element starting from 0 // order_of_key(k) returns count of elements strictly smaller than k #define fix(f,n) std::fixed< #define pii pair #define vii vector #define vvi vector //#define max(a,b) ((a>b)?a:b) //#define min(a,b) ((a>b)?b:a) #define min3(a,b,c) min(min(a,b),c) #define min4(a,b,c,d) min(min(a,b),min(c,d)) #define max3(a,b,c) max(max(a,b),c) #define max4(a,b,c,d) max(max(a,b),max(c,d)) #define ff(a,b,c) for(int a=b; a<=c; a++) #define frev(a,b,c) for(int a=c; a>=b; a--) #define REP(a,b,c) for(int a=b; a' #define lb lower_bound // '>=' #define qi queue #define si stack //FLags -> -Wfloat-equal -fsanitize=address -fsanitize=undefined // Swap only swaps data but not memory pointer to that data structures const long double PI = acos(-1); mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count()); int rng(int lim) { uniform_int_distribution uid(0,lim-1); return uid(rang); } ll gcdExtended(ll a, ll b, ll *x, ll *y){ if(a == 0){ *x = 0; *y = 1; return b; } ll x1, y1; ll gcd = gcdExtended(b%a, a, &x1, &y1); *x = y1 - (b/a) * x1; *y = x1; return gcd; } ll modInverse(ll a, ll m){ ll x, y; ll g = gcdExtended(a, m, &x, &y); ll res = (x%m + m) % m; return res; } ll binary_Search(vector&arr,ll key){ ll l=0,r=arr.size()-1; ll ans; while(l<=r){ ll mid=(l+r)/2; ll value=arr[mid]; if(value>key){ r=mid-1; }else if(value==key){ return mid; }else{ l=mid+1; } } return -1; } ll power(ll x,ll y,ll p){ ll res = 1; x = x % p; if (x == 0) return 0; while (y > 0){ if (y & 1){ res=(res*x)%p; } y = y>>1; x = (x*x) % p; } return res; } // ll check(ll x){ // ll tem=sqrt(x); // while((tem*tem)<=x) tem++; // while((tem*tem)>x) tem--; // return tem; // } // ll check1(ll x){ // ll tem=sqrt(x); // while((tem*tem)<=x) tem++; // while(((tem-1)*(tem-1))>=x) tem--; // return tem; // } const ll MAX=1e18+5; //const int N=1e6+5; const int N1=5*1e3+5; //vector pr; // ll prime[N+5]; // void SieveOfEratosthenes(){ // memset(prime, 0, sizeof(prime)); // prime[1]=1; // for(ll p=2 ; p V; void TEST_CASE(){ int i, j, k, l, r, x, y; string s; cin >> N >> M >> K; FOR (x, 100 ) FOR (y, 100 ) mat [x] [y] = 1000 ; FOR (x, 100 ) mat [x] [x] = 0 ; FOR (i, M) { cin >> x >> y; mat [x- 1 ] [y- 1 ] = mat [y- 1 ] [x- 1 ] = 1 ; } FOR (i, N) FOR (x, N) FOR (y, N) mat [x] [y] = min (mat [x] [y], mat [x] [i] + mat [i] [y ]); V.push_back ( 0 ); ll ret = 0 ; for (i = N- 1 ; i> 0 ; i--) { if (V.size() >= K + 1 ) break ; V.push_back (i); memset (dp, 0x3f , sizeof (dp)); dp [ 1 ] [ 0 ] = 0 ; for ( int mask = 1 ; mask < 1 << V.size (); mask ++) { FOR (x, V.size ()) if (mask & ( 1 << x)) { FOR (y, V.size ()) if (x!= y && (mask & ( 1 << y))) dp [mask] [x] = min (dp [mask] [x], dp [mask ^ ( 1 << x)] [y] + mat [V [x]] [V [y]]); } } int ok = 0 ; FOR (j, V.size ()) if (dp [( 1 << V.size ())- 1 ] [j] <= K) ok ++; if (ok == 0 ) V.pop_back (); else ret += ( 1LL << i) -1 ; } cout << ret << endl; } signed main(){ fast; //freopen ("INPUT.txt","r",stdin); //freopen ("OUTPUT.txt","w",stdout); int test=1,TEST=1; precompute(); //cin >> test; while(test--){ //cout << "Case #" << TEST++ << ": "; TEST_CASE(); } return 0; }