let denote Lxp infinite sequence integer y gcdpy1 yx gcd great common divisor integer number sort ascending order the element Lxp 1indexed example 9 13 15 second element l722 respectivelyYou process t query each query denote integer x p k answer query kth element Lxp