For every element arr [ i ] , x is count of occurrence of arr [ i ] in different set such that index of arr [ i ] in those sets divides m completely .
long long int x = 0 ; for ( lli j = 1 ; j <= m ; j ++ ) {