One day at group-”NDC TOP 100” of Notre Dame College, the ICT teacher gave the a students' a task by forming Q teams. He wrote N numbers in the board in a single line and called them array W. After that to each team, he gave five variables .
Let, index be a point of division of the numbers from to i.e,
Let,
Now he asked them if it was possible to find an index such that . If there are multiple solutions then find an index such that it minimizes
Note: The GXP function of any array with a given range to and parameter is the multiplication of the all the numbers in that range raised to the power i.e,
Now there was a team which consist of two students naming Farhan Ishrak and Azmain Muksit. They were so called "Matbor" in their class. They wanted to solve all of the other teams' solutions along with their own to look cool. That being said, they collected every variable from the others. There was a problem though, they could not even solve their own. Thus they hired you to solve the problems on their behalf. Well, can you figure out the solution?
For each team, if the answer is Yes, then print followed by the valid index in a new line (see explanation of sample test case for better understanding), else print .
Subtask 1 (for points):
Subtask 2 (for points):
Subtask 3 (for points): General Constraints
Input | Output |
---|---|
5 2 3 5 7 5 2 1 5 2 5 2 1 4 2 5 4 | YES 3 NO |
For the first team, when , and which meets the given condition and is minimized
For the second team, the highest possible value of that can be found is which is less than