#ifdef KOMAKI_LOCAL #include #else #define NDEBUG #endif #include #include #include using namespace std; #define i64 int64_t #define rep(i, n) for(i64 i = 0; i < ((i64)(n)); ++i) #define sz(v) ((i64)((v).size())) #define bit(n) (((i64)1)<<((i64)(n))) #define all(v) (v).begin(), (v).end() template void deploy(std::ostream &os, const TUPLE &tuple){} template void deploy(std::ostream &os, const TUPLE &t){ os << (POS == 0 ? "" : ", ") << get(t); deploy(os, t); } template std::ostream& operator<<(std::ostream &os, const std::tuple &t){ os << "("; deploy<0, std::tuple, Ts...>(os, t); os << ")"; return os; } template std::ostream& operator<<(std::ostream &os, std::vector &v){ int remain = v.size(); os << "{"; for(auto e: v) os << e << (--remain == 0 ? "" : ", "); os << "}"; return os; } template std::ostream& operator<<(std::ostream &os, std::set &v){ int remain = v.size(); os << "{"; for(auto e: v) os << e << (--remain == 0 ? "" : ", "); os << "}"; return os; } template std::ostream& operator<<(std::ostream &os, std::queue &q){ auto qq = q; os << "{"; for(; !qq.empty(); qq.pop()){ os << qq.front() << (qq.size() != 1 ? ", " : ""); } os << "}"; return os; } template std::ostream& operator<<(std::ostream &os, std::priority_queue &q){ auto qq = q; os << "{"; for(; !qq.empty(); qq.pop()){ os << qq.top() << (qq.size() != 1 ? ", " : ""); } os << "}"; return os; } template std::ostream& operator<<(std::ostream &os, std::pair &p){ os << "(" << p.first << ", " << p.second << ")"; return os; } template std::ostream& operator<<(std::ostream &os, std::map &mp){ int remain = mp.size(); os << "{"; for(auto e: mp) os << "(" << e.first << " -> " << e.second << ")" << (--remain == 0 ? "" : ", "); os << "}"; return os; } template std::ostream& operator<<(std::ostream &os, std::unordered_map &mp){ int remain = mp.size(); os << "{"; for(auto e: mp) os << "(" << e.first << " -> " << e.second << ")" << (--remain == 0 ? "" : ", "); os << "}"; return os; } #define DEBUG0() { char buf[1000]; sprintf(buf, "line:%3d | ", __LINE__); std::cout << buf << std::endl; } #define DEBUG1(var0) { char buf[1000]; sprintf(buf, "line:%3d | ", __LINE__); std::cout << buf << (#var0) << "=" << (var0) << std::endl; } #define DEBUG2(var0, var1) { char buf[1000]; sprintf(buf, "line:%3d | ", __LINE__); std::cout << buf << (#var0) << "=" << (var0) << ", " << (#var1) << "=" << (var1) << std::endl; } #define DEBUG3(var0, var1, var2) { char buf[1000]; sprintf(buf, "line:%3d | ", __LINE__); std::cout << buf << (#var0) << "=" << (var0) << ", " << (#var1) << "=" << (var1) << ", " << (#var2) << "=" << (var2) << std::endl; } #define DEBUG4(var0, var1, var2, var3) { char buf[1000]; sprintf(buf, "line:%3d | ", __LINE__); std::cout << buf << (#var0) << "=" << (var0) << ", " << (#var1) << "=" << (var1) << ", " << (#var2) << "=" << (var2) << ", " << (#var3) << "=" << (var3) << std::endl; } #define DEBUG5(var0, var1, var2, var3, var4) { char buf[1000]; sprintf(buf, "line:%3d | ", __LINE__); std::cout << buf << (#var0) << "=" << (var0) << ", " << (#var1) << "=" << (var1) << ", " << (#var2) << "=" << (var2) << ", " << (#var3) << "=" << (var3) << ", " << (#var4) << "=" << (var4) << std::endl; } #define DEBUG6(var0, var1, var2, var3, var4, var5) { char buf[1000]; sprintf(buf, "line:%3d | ", __LINE__); std::cout << buf << (#var0) << "=" << (var0) << ", " << (#var1) << "=" << (var1) << ", " << (#var2) << "=" << (var2) << ", " << (#var3) << "=" << (var3) << ", " << (#var4) << "=" << (var4) << ", " << (#var5) << "=" << (var5) << std::endl; } const i64 MAX = 66; vector edges[MAX]; int main() { i64 n, m, k; cin >> n >> m >> k; rep(i, m){ i64 u, v; cin >> u >> v; edges[u - 1].push_back(v - 1); edges[v - 1].push_back(u - 1); } i64 mask = 0; for(i64 t = n - 1; 0 <= t; --t){ i64 next = mask | bit(t); vector> cur(n); cur[0].insert(next & bit(0)); rep(step, k){ vector> v(n); rep(pos, n)for(auto t: cur[pos])for(auto adj: edges[pos]){ v[adj].insert(t | (next & bit(adj))); } cur = v; } rep(pos, n)for(auto t: cur[pos])if(t == next) mask = next; } i64 ans = 0; rep(i, n)if(mask & bit(i)) ans += bit(i) - 1; cout << ans << endl; }