Object[] worst(double D[][], int n, int R[], int Rmax) {
        //[L] = find(R==Rmax);
        Vector<Integer> Ltmp = new Vector<Integer>();

        for (int i = 0; i < R.length; i++) {
            if (R[i] == Rmax) {
                Ltmp.add(new Integer(i));
            }
        }
        int L[] = new int[Ltmp.size()];
        for (int i = 0; i < Ltmp.size(); i++) {
            L[i] = Ltmp.get(i).intValue();
        }

        int nA = L.length;
        double A[][] = new double[nA][n];
        for (int i = 0; i < L.length; i++) {
            for (int j = 0; j < n; j++) {
                A[i][j] = D[L[i]][j];
            }
        }
        return new Object[]{A, L, new Integer(nA)};
    }