Big bang nucleosynthesis constraints on hadronically and electromagnetically decaying relic neutral particles