ROOBOT  Robot
There is a robot on the 2D plane. Robot initially standing on the position (0, 0). Robot can make a 4 different moves:
 Up (from (x, y) to (x, y + 1)) with probability U.
 Right (from (x, y) to (x + 1, y)) with probability R.
 Down (from (x, y) to (x, y  1)) with probability D.
 Left (from (x, y) to (x  1, y)) with probability L.
After moving N times Robot gets points.
 Let x_{1} be the smallest coordinate in Xaxis, that Robot reached in some moment.
 Let x_{2} be the largest coordinate in Xaxis, that Robot reached in some moment.
 Let y_{1} be the smallest coordinate in Yaxis, that Robot reached in some moment.
 Let y_{2} be the largest coordinate in Yaxis, that Robot reached in some moment.
Points achieved by Robot equals to x_{2}  x_{1} + y_{2}  y_{1}.
Given N, U, R, D, L. Calculate expected value of points that Robot achieved after N moves.
Input
First line: One interger N (1 ≤ N ≤ 200).
Second line: Four real numbers U, R, D, L (U + R + D + L = 1, 0 ≤ U, R, D, L ≤ 1) with maximum of 6 numbers after dot.
Output
One number: expected value of points achieved by Robot. The answer will be considered correct if its relative or absolute error does not exceed 10^{6}.
Example 1
Input: 2 0.100000 0.200000 0.300000 0.400000 Output: 1.780000
Example 2
Input: 3 0.25 0.25 0.25 0.25 Output: 2.375000
hide comments
Luka ï¿½eï¿½eroviï¿½:
20160404 16:30:53
Please give us more test cases! Thanks in advance :) 

Scape:
20150908 22:00:46
Any tricky test cases? Getting wrong answer even with long doubles.


Sourav Kumar:
20150902 21:33:09
Could someone give a few more test cases? 
Added by:  Bartek 
Date:  20150830 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 GOSU JSMONKEY 