Find argsort and 'list of cuts' of a 1D 'double' array
a: a 1D 'double' array
id: an index array that sorts a in ascending orders B: an array of thresholds that cuts a properly