Divisible subarray codechef problem

here we try to find out divisible subarrays . but if there no divisible subarrays but have divisible subsets then how to solve? as we are asked to find divisible subsets in this question

hello @rick711c

all subarray is a subset of array.
and since their will always exist atleast one subarray with sum%n=0 we dont need to bother non contigous subset.
for proof check its editorial.

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.