Sticking Pins

Limits: 1s, 512 MB

You are sticking pins on a 2D board at N given coordinates. However, since you are not very good at sticking pins, once you try to hang the board on the wall, some pins might just fall off. You will be given the probabilities that a pin might fall off from the board. The events that represent the falling of individual pins are mutually independent.


This is a companion discussion topic for the original entry at https://toph.co/p/sticking-pins