题目链接:http://codeforces.com/problemset/problem/782/E

#include <bits/stdc++.h>
using namespace std;

vector<int> e[200005], f;
bool vis[200005]={0};
void dfs(int u){
    vis[u]=1;
    f.push_back(u);
    for(int i=0; i<e[u].size(); i++){
        if(!vis[e[u][i]]){
            dfs(e[u][i]);
            f.push_back(u);
        }
    }
}

int main(){

    int n, m, k, u, v;
    scanf("%d%d%d", &n, &m, &k);
    for(int i=1; i<=m; i++){
        scanf("%d%d", &u, &v);
        e[u].push_back(v);
        e[v].push_back(u);
    }
    dfs(1);
    int Len=2*n/k+((2*n%k==0)?0:1);
    int cut=0;
    int s=0;
    for(int i=0; i<f.size(); i++){
        if(cut!=0){
            printf("%d ", f[i]);
            cut--;
        }else{
            if(i){
                printf("\n");
            }
            if(f.size()-i>=Len){
                printf("%d ", Len);
            }
            else{
                printf("%d ", f.size()-i);
            }
            s++;
            printf("%d ", f[i]);
            cut=Len-1;
        }
    }
    printf("\n");
    while(s+1<=k){
        printf("1 1\n");
        s++;
    }

    return 0;
}