Solving technique

The problem
https://www.codechef.com/CP7D2021/problems/CHEFPROB

Can you tell me how to do this problem

hello @Somasree

basically u need to find number of subarray whose sum is less than T (say cnt is count of such subarrys).

and then u simply have to print

 cnt/ ( n(n+1)/2)  ie  required subarrays / total possible subarrays

hint to find required subarrays -> prefix sum + binary search

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.