Two type of operations ↵
↵
Type1: replace A[i] by A[i]-1↵
↵
Type2: Replace A[i] to 0. ↵
↵
Determine maximum length of subarray that can be obtained if all elements of subarray are zero and you can apply max operations of x and y of type 1 and 2 respectively.↵
↵
Constraints:↵
1<=T<=7↵
↵
1<=N<=1e5↵
↵
0<=A[i]<=1e9↵
↵
0<=Y<=1e9↵
↵
0<=X<=1e14.↵
↵
↵
↵
Reference Images:↵
![ ](/predownloaded/a2/fd/a2fd0c637b8379848593bc341af2126ed9de1ec1.png)↵
![ ](/predownloaded/60/27/602732e9893e434464c89a187b9188374f0db2ed.png)↵
![ ](/predownloaded/f5/c2/f5c2fd81c3f84e735fcc362b948f957a19af070b.png)
↵
Type1: replace A[i] by A[i]-1↵
↵
Type2: Replace A[i] to 0. ↵
↵
Determine maximum length of subarray that can be obtained if all elements of subarray are zero and you can apply max operations of x and y of type 1 and 2 respectively.↵
↵
Constraints:↵
1<=T<=7↵
↵
1<=N<=1e5↵
↵
0<=A[i]<=1e9↵
↵
0<=Y<=1e9↵
↵
0<=X<=1e14.↵
↵
↵
↵
Reference Images:↵
![ ](/predownloaded/a2/fd/a2fd0c637b8379848593bc341af2126ed9de1ec1.png)↵
![ ](/predownloaded/60/27/602732e9893e434464c89a187b9188374f0db2ed.png)↵
![ ](/predownloaded/f5/c2/f5c2fd81c3f84e735fcc362b948f957a19af070b.png)