protected static final boolean solve (long[] smp, long[] evA, long[] evB, int mA, int mB, long[] pA, long[] pB) throws Exception {
        int mbar = smp.length;
        int delta = mA - mB;
        int tmA = (mbar + delta) / 2;
        int tmB = (mbar - delta) / 2;
        if(tmA < 0 || tmB < 0 || tmA + tmB <= 0) return false;
        
        long[] evl = new long[mbar];
        for (int i = 0; i < mbar; i++) evl[i] = PF.div(evA[i], evB[i]);

        int rank = tsolv(smp, evl, tmA, tmB, pA, pB);
        if (rank > tmA + tmB)  return false;
        if (rank == tmA + tmB) return true;       
        if (rank == 0) return false;

        int mDiff = tmA + tmB - rank;
        tmA -= mDiff;
        tmB -= mDiff;

        if (tmA <= 0 || tmB <= 0) {
            tmA = rank;
            tmB = 0;
        }
                               
        rank = tsolv(smp, evl, tmA, tmB, pA, pB);
        return (rank == tmA + tmB);
    }