Create the file in directories which are in (a) and not in (b). Check grep -f.