You are given an array A of size N and a number C.
We define the beauty number of a number X is defined as:
- We have a universal array U where all the integers from -10^18 to 10^18 are present in sorted order [10^18,1-10^18,......,0,1,2,3,......10^18].
- Now the beauty number of X is the number of subarrays of U with the sum X.
Find the number of elements in array A whose beauty number is strictly greater than C.
Constraints:
- 1<=N<=10^5
- 1<=C<=10^12
- 1<=A[i]<=10^5
Test cases:
N = 1, C = 2, A = [12] Output: 1 The beauty number of 12 is 4. the result is 1. [12],[3,4,5],[-2,-1,0,1,2,3,4,5],[-11,-10,.....12]
N = 1, C = 12, A = [2] the beauty number of 2 is 2([2],[-1,0,1,2]
Can anyone help me to solve this