iterate over each given query
for ( int i = 0 ; i < q ; i ++ ) { int GCD = answer [ queries [ i ] ] ; System . out . print ( " For ▁ subtree ▁ of ▁ " + queries [ i ] + " , ▁ GCD ▁ = ▁ " + GCD + "NEW_LINE"); } }