The point at which you become aware of the situation you become a part of it. If you are aware of your ability to save 5 people then it becomes a question of costs. Doing nothing to save those 5 people when you are aware of a way to avert their fate puts some responsibility on you. Certainly not as much as the person who knowingly put the whole charade in motion, but you still have some. The question then becomes, does the cost involved with in killing one person outweigh the profits of saving 5 people? Simple moral economics. But make no mistake, if you are aware of something, you are a part of it and thus share responsibility in its outcome.