[Solution] 2^Sort Codeforces Solution | Codeforces Problem Solution 2022
G. 2^Sort
time limit per test
1 secondmemory limit per test
256 megabytesinput
standard inputoutput
standard outputGiven an array of length and an integer , find the number of indices such that the subarray with length (not with length ) has the following property:
- If you multiply the first element by , the second element by , ..., and the ()-st element by , then this subarray is sorted in strictly increasing order.
Input
The first line contains an integer () — the number of test cases.
Solution Click Below:- CLICK HERE
The first line of each test case contains two integers , (, ) — the length of the array and the number of inequalities.
The second line of each test case contains integers () — the elements of the array.
The sum of across all test cases does not exceed .
Output
For each test case, output a single integer — the number of indices satisfying the condition in the statement.
No comments:
Post a Comment