Yes option B IS CORRECT as to maintain the referential integrity of the table after deleting 20,40 where 20 being the PK,ANY VALUE 20 in the foreign key to be deleted and son on.
Hence (35,20 ) to be deleted.
further deleting (35,20 ) where 35 being PK and in order to maintain referential integrity any VALUE 35 in the foreign key must be deleted i.e (30,35 )
further no value eaqual to 30 in foreign key column is found,
hence the option B is correct.