* Time Limit:4000MS Memory Limit:102400KB 64bit IO Format:%I64d & %I64u
* Submit
* Status
* Description
* Michael has a telecontrol robot. One day he put the robot on a loop with n cells. The cells are numbered from 1 to n clockwise.
* At first the robot is in cell 1. Then Michael uses a remote control to send m commands to the robot. A command will make the robot walk some distance. Unfortunately the direction part on the remote control is broken, so for every command the robot will chose a direction(clockwise or anticlockwise) randomly with equal possibility, and then walk w cells forward.
* Michael wants to know the possibility of the robot stopping in the cell that cell number >= l and <= r after m commands.
* Input
* There are multiple test cases.
* Each test case contains several lines.
* The first line contains four integers: above mentioned n(1≤n≤200) ,m(0≤m≤1,000,000),l,r(1≤l≤r≤n).
* Then m lines follow, each representing a command. A command is a integer w(1≤w≤100) representing the cell length the robot will walk for this command.
* The input end with n=0,m=0,l=0,r=0. You should not process this test case.
* Output
* For each test case in the input, you should output a line with the expected possibility. Output should be round to 4 digits after decimal points.
* Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
* Total Submission(s): 9174 Accepted Submission(s): 4061
* Special Judge
* <p>
* Problem Description
* FatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you want to take the data on a collection of mice and put as large a subset of this data as possible into a sequence so that the weights are increasing, but the speeds are decreasing.
*
* <p>
* Input
* Input contains data for a bunch of mice, one mouse per line, terminated by end of file.
* <p>
* The data for a particular mouse will consist of a pair of integers: the first representing its size in grams and the second representing its speed in centimeters per second. Both integers are between 1 and 10000. The data in each test case will contain information for at most 1000 mice.
* <p>
* Two mice may have the same weight, the same speed, or even the same weight and speed.
*
* <p>
* Output
* Your program should output a sequence of lines of data; the first line should contain a number n; the remaining n lines should each contain a single positive integer (each one representing a mouse). If these n integers are m[1], m[2],..., m[n] then it must be the case that
* <p>
* W[m[1]] < W[m[2]] < ... < W[m[n]]
* <p>
* and
* <p>
* S[m[1]] > S[m[2]] > ... > S[m[n]]
* <p>
* In order for the answer to be correct, n should be as large as possible.
* All inequalities are strict: weights must be strictly increasing, and speeds must be strictly decreasing. There may be many correct outputs for a given input, your program only needs to find one.