Query on a tree

Problem Name:
Query on a tree
Site:Spoj
Links:
Tags:
Problem setters: