Quantum state engineering using conditional measurement on a beam splitter