GOT - Gao on a tree

题意翻译

题目大意:给你一棵树,每个点有点权,询问点a到点b的路径中是否有点的点权为c

题目描述

There's a tree, with each vertex assigned a number. For each query (a, b, c), you are asked whether there is a vertex on the path from a to b, which is assigned number c?

输入输出格式

输入格式


There are multiple cases, end by EOF. For each case, the first line contains n (n <= 100000) and m (m <= 200000), representing the number of vertexes (numbered from 1 to n) and the number of queries. Then n integers follows, representing the number assigned to the i-th vertex. Then n-1 lines, each of which contains a edge of the tree. Then m lines, each of which contains three integers a, b and c (0 <= c <= n), representing a query.

输出格式


You should output "`Find`" or "`NotFind`" for every query on one line. Output a blank line AFTER every case.

输入输出样例

输入样例 #1

5 5
1 2 3 4 5
1 2
1 3
3 4
3 5
2 3 4
2 4 3
2 4 5
4 5 1
4 5 3

输出样例 #1

NotFind
Find
NotFind
NotFind
Find