Socrates, Plato, and Newton engage in a conversation about Love.
Socrates said, "Go into the field and find the most extraordinary flower. However, you cannot turn back, and you only have one chance to pick a flower."
Plato did so, but he returned empty-handed after a considerable amount of time. He mentioned that he had come across some truly remarkable flowers earlier, but he thought he might find even better ones, so he passed them by. Unfortunately, the subsequent flowers did not surpass the ones he had seen before, resulting in him returning without any flowers.
On the other hand, Newton approached the problem using a mathematical model. Suppose there are flowers, and the -th flower is assigned a positive integer value initially. The scenario involves events that occur chronologically. These events can be classified into three different types:
A person walks from the -th flower to the -th flower.
The person passes each flower from to one by one.
The person assigns a score to each flower, which is calculated by dividing its value by the maximum value among the
flowers encountered during the walk (i.e., ).
Newton wants to determine the average score of the walk, given by .
The value of the -th flower is set to (i.e., ).
The values of the flowers from the -th flower to the -th flower are set to (i.e., ).
The first line of input contains two integers and .
The second line of input consists of integers. The -th integer represents the initial value of .
The next lines of input each consist of a description of an event, listed chronologically. On the -th line, the first integer denotes the type of event .
If , then two integers and follow, indicating the event where a person walks from the -th flower to the -th flower.
If , then two integers and follow, indicating the event where the value of the -th flower is set to .
If , then three integers , , and follow, indicating the event where the value of the flowers from the -th flower to the -th flower is set to .
For each event , output a number in a line, representing the average score of the walk. Your answer is considered correct if its absolute or relative error doesn't exceed . Namely, let your answer be , and the judge's be , your answer will be accepted if .