1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
#include <bits/stdc++.h>
#define dbg(x) " [" << #x << ": " << (x) << "] "
using namespace std;
template<typename A,typename B>
ostream& operator<<(ostream& out,const pair<A,B>& p) {
    return out << "(" << p.first << ", " << p.second << ")";
}
template<typename T>
ostream& operator<<(ostream& out,const vector<T>& c) {
    out << "{";
    for(auto it = c.begin(); it != c.end(); it++) {
        if(it != c.begin()) out << ", ";
        out << *it;
    }
    return out << "}";
}
int n,m,k;
vector<vector<pair<int,int>>> g;
vector<vector<pair<int,int>>> gg;
vector<unordered_map<int,int>> mp;
int bfs() {
    queue<int> q;
    q.push(0);
    vector<int> u(2 * n + 2);
    vector<pair<int,int>> prv(2 * n + 2);
    u[0] = 1;
    while(!q.empty()) {
        int v = q.front();
        if(v == 2 * n + 1) break;
        q.pop();
        int i = 0;
        for(auto [to,cst] : g[v]) {
            if(!u[to] && cst) {
                u[to] = 1;
                prv[to] = {v,i};
                q.push(to);
            }
            i++;
        }
    }
    if(!u[2 * n + 1]) return 0;
    int cur = 2 * n + 1;
    while(cur != 0) {
        int prev = prv[cur].first;
        int id = prv[cur].second;
        g[prev][id].second--;
        g[cur][mp[cur][prev]].second++;
        cur = prev;
    }
    return 1;
}
void solve() {
    cin >> n >> m >> k;
    g.resize(2 * n + 2);
    mp.resize(2 * n + 2);
    for(int i = 1; i <= n; i++) {
        if(i <= k) {
            mp[0][i] = g[0].size();
            g[0].push_back({i,1});
            mp[i][0] = g[i].size();
            g[i].push_back({0,0});
        }
        mp[i][i + n] = g[i].size();
        g[i].push_back({i + n,1});
        mp[i + n][i] = g[i + n].size();
        g[i + n].push_back({i,0});
    }
    for(int i = 0; i < m; i++) {
        int a,b;
        cin >> a >> b;
        mp[a + n][b] = g[a + n].size();
        g[a + n].push_back({b,1});
        mp[b][a + n] = g[b].size();
        g[b].push_back({a + n,0});
    }
    gg = g;
    vector<int> ans(k + 1);
    for(int i = k + 1; i <= n; i++) {
        int fl = 0;
        for(int j = i; j <= n; j++) {
            mp[j + n][2 * n + 1] = g[j + n].size();
            g[j + n].push_back({2 * n + 1,1});
            mp[2 * n + 1][j + n] = g[2 * n + 1].size();
            g[2 * n + 1].push_back({j + n,0});
            fl += bfs();
            ans[fl]++;
            if(fl == k) {
                ans[k] += n - j;
                break;
            }
        }
        g = gg;
    }
    for(int i = 0; i <= k; i++) {
        cout << ans[i] << endl;
    }
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int testNum = 1;
    //cin >> testNum;
    for(int i = 1; i <= testNum; i++) {
        solve();
    }
    return 0;
}