|All-time Popular Problems|
|Construct Tree from Inorder & Preorder|
|Sum of two large numbers|
|Level order traversal in spiral form|
|Spirally traversing a matrix|
|Angle between hour and minute hand|
|Binary Tree to DLL|
|Smallest Positive missing number|
|Height of Binary Tree|
|Largest Number formed from an Array|
Given an array of integers, evaluate queries of the form LCM(l, r). There might be many queries, hence evaluate the queries efficiently.
The first line of input contains an integer t denoting the number of test cases. Then T test cases follow. Each test case contains two integers n denoting the size of the array and number of queries. The next line contains n space separated integers forming the array. The last line contains the range a and b for each query.
Print the lcm for each query.
1<=data of node<=100
1<=no of queries<=100
5 7 5 2 10 12 11 17 14 1 44
2 5 5 10 0 10
60 15708 78540