Problem 4011 · Medium

Count Subarrays With Even Odd Ratio I

Extend each subarray to the right, keeping even and odd counts; a subarray counts when it has an odd value and its even-to-odd ratio is at most a/b, compared without division.

Open the interactive visualisation