Boarding on the Junior Plane
N passengers are boarding a plane that has exactly N seats. Each passenger holds a ticket for a specific seat, and all tickets are unique. However, some passengers are unpredictable. Passengers board the plane one at a time. Unpredictable passengers ignore their tickets and choose a seat at random from those available. In contrast, normal passengers will sit in their assigned seat if it's free. If their seat is already taken, they will choose any available seat at random, with equal probability. Your task is to calculate the probability that each passenger will sit in their assigned seat when they board the plane.
Constraints
N is an integer, where 1 ≤ N ≤ 15.
Input
The first line contains the integer N. The second line lists N numbers, indicating the type of each passenger in the order they board the plane (0 for a normal passenger, 1 for an unpredictable passenger).
Output
Output N numbers, each representing the probability that the corresponding passenger will sit in their assigned seat. Each probability must be presented with a precision of at least 10^{-8}.