This zebra crossing can be viewed as a tree with nodes. The -th edge connects node and node . Each node is colored either black or white, described by a binary string of length :
If , the color of node is black.
If , the color of node is white.
Yuki has a jumping ability , which means that when she is at node , she can jump to any node such that . Here, denotes the number of edges on the simple path between node and node .
Next, Yuki will perform rounds of jumping on the zebra crossing. In the -th round, Yuki starts at node and wants to reach node through a sequence of jumps. At the same time, Yuki wants to minimize the number of times she lands on a black node after her jumps.
You need to help Yuki find the minimum number of times she lands on a black node for each round of jumping.
输入格式
This problem contains multiple test cases.
The first line contains a positive integer , representing the number of test cases.
For each test case:
The first line contains two positive integers .
The second line contains a binary string of length .
The next lines each contain two positive integers .
It is guaranteed that the sum of over all test cases does not exceed .
输出格式
For each test case, output a single line containing integers, where the -th integer represents the minimum number of times Yuki lands on a black node during the -th round of jumping.