1 teams scored 15 points on this task, for a maximum score of 15, an average score of 15 and a median score of 15.
You have a tree (a connected acyclic graph) of N nodes indexed from 1 to N. Each node i has an integer value V_i > 1 assigned to it. You are given Q queries, where each query i consists of two integers A_i and B_i. Your task is to find the minimum value (greater than 1) that is not divisible by any of the assigned values on the path between A_i and B_i, including the values assigned to A_i and B_i.