give positive integer n exist 0indexed array call power compose minimum number power 2 sum n the array sort nondecrease order way form arrayYou give 0indexed 2D integer array query queriesi lefti righti each queriesi represent query find product powersj lefti j rightireturn array answer equal length query answersi answer ith query since answer ith query large answersi return modulo 109 7 Example 1input n 15 query 012203output 2464explanationfor n 15 power 1248 it show power small sizeanswer 1st query powers0 powers1 1 2 2answer 2nd query powers2 4answer 3rd query powers0 powers1 powers2 powers3 1 2 4 8 64each answer modulo 109 7 yield answer 2464 returnedExample 2input n 2 query 00output 2explanationfor n 2 power 2the answer query powers0 2 the answer modulo 109 7 2 return Constraints1 n 1091 querieslength 1050 starti endi powerslength