You are given an array of size n, consisting of non negative integers. Find the number of subarrays of arr which are special. A subarray is special if it satisfies the following condition: The product of the maximum and the minimum element of the subarray is divisible by the length of the subarray. Find the number of special subarrays of the array.
1<=n<=1e5
Not able to find solution less than n^2. Please someone help
What is the range of $$$a_i$$$?
I think this has already been answered here.
https://mirror.codeforces.com/blog/entry/118209
Oh bro, this guy omits the range of $$$a_i$$$.