Cross sections for binary and ternary fission induced by high-energy protons in uranium and lead