There are fun times ahead for ICPS (Icelandic Competitive
Programming Society). ICPS is planning to hold a big party.
First thing to prepare is to order some food. As often before
it is agreed to order some pizza from Trominos. They look up
the waiting time and see that they offer a forecast for how
long the waiting time will be as a function of when you order.
If an order is placed at time
then the waiting time is given by
where are
coefficients that change from day to day. This poses a problem
as there is an agreement that the pizza should be ready at time
, so when should it be
ordered? Despite having decent resources ICPS can not place an
order in the past. The decision to order pizza was made at time
.
Input
The first line of the input contains one floating point
number which has at most six digits after the decimal.
This is the time that ICPS wants the pizza to be ready at. The
next line contains four floating point numbers which
also have at most six digits after the decimal. These
coefficients determine the waiting time function as given
above.
Output
If there exists no time such that the pizza is ready at
time , print ‘O nei!’.
Otherwise print one line with the number , the time such that if an order is
placed at time it is
ready at time . If
there is more than one such time , print the smallest positive valid
. An answer is correct
if its relative or absolute error is smaller than .
Sample Input 1 |
Sample Output 1 |
2.0
0.0 0.0 0.0 1.0
|
0.5591153088522895
|
Sample Input 2 |
Sample Output 2 |
2.0
2.0 1.0 1.0 1.0
|
O nei!
|