1 4 1 2 1 3 1 4
4 12 4 1 Let us represent the configuration of stones by the sequence of vertices where the stones numbered $1, 2, \ldots, K$ are placed. * For $K=1$, there are $4$ possible configurations: $(1), (2), (3), (4)$. * For $K=2$, there are $12$ possible configurations: $(1,2), (1,3), (1,4), (2,1), (2,3), (2,4), (3,1), (3,2), (3,4), (4,1), (4,2), (4,3)$. * For $K=3$, there are $4$ possible configurations: $(1,2,3), (4,1,3), (4,2,1), (4,2,3)$. * For $K=4$, there is $1$ possible configuration: $(1,2,3,4)$. For $K=3$, refer to the following figure. 
4 1 5 1 4 5 2 3 4 2 1 7 1 7 2 7 5 6 4 1 1 6 3 6 10 1 2 2 3 3 4 4 5 5 6 2 7 3 8 4 9 5 10
1 5 10 10 5 1 7 42 210 840 84 7 1 10 90 720 5040 30240 151200 604800 720 10 1 The tree given in each test case is as follows: 
{
"problem": {
"name": "Sliding Puzzle On Tree",
"description": {
"content": "You are given a tree with $N$ vertices numbered $1$ to $N$. The $i$\\-th edge of the tree connects vertices $u_i$ and $v_i$. For each $K=1, 2, \\ldots, N$, solve the following problem: > There are $K$ ",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "agc066_e"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given a tree with $N$ vertices numbered $1$ to $N$. The $i$\\-th edge of the tree connects vertices $u_i$ and $v_i$.\nFor each $K=1, 2, \\ldots, N$, solve the following problem:\n\n> There are $K$ ...",
"is_translate": false,
"language": "English"
}
]
}