You are given an array A of N positive integers.
The product of a subarray is said to be special if it has an odd number of positive divisors.
Count the number of contiguous subarrays whose product is special.
Print a single integer — the number of special subarrays.
5 1 4 2 9 16
6
A number has an odd number of divisors if and only if it is a perfect square.
The qualifying subarrays are:
Hence, the answer is 6.