Here is an Easy Problem of Zero-chan
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Zero-chan has a rooted tree with n nodes. The root of given tree is node 1. She defines .

lca(u,v) meas the Least Common Ancestor of node u and node v.

Zero-chan gives you some integers x and asks you to calculate: the number of suffix zeros of f(x)

输入描述:

First line contains 2 integers n,q ( - the size of given tree and the number of queries.

Each of the next n -1 lines contains two integers u,v () indicating an undirected edge between node u and node v. It is guaranteed that the given edges form a tree.

The following line containing q integers describes the queries. Each of query has a integer x ().

输出描述:

For each query, print a integer - the answer of the query.
示例1

输入

复制
5 5
2 3
5 4
2 5
1 5
1 2 3 4 5

输出

复制
0
2
1
2
0