Yami
Winnie-the-Pooh is thrilled—he's just bought a car! To test his new purchase, he plans to drive to a tree where the perfect honey awaits.
The journey from Winnie-the-Pooh's house to the tree is n kilometers long. Although there are no speed limits in his area, making it seem like he could drive as fast as he wants, there's a catch that brings him to you for help.
The road has potholes in certain sections. To keep his new car in good condition (which he certainly wants to do), Winnie must drive over any kilometer with a pothole at a speed no greater than k kilometers per hour. The car is designed to adjust its speed after each kilometer: it can accelerate by one kilometer per hour, decelerate by the same amount, or maintain its current speed. After adjusting, it will travel exactly one kilometer at the new speed, and then it can adjust again.
Another feature of the car is that it cannot instantly accelerate to any speed, but it can stop immediately (thanks to a brake parachute). Thus, the first kilometer of the journey will always be traveled at a speed of 1 kilometer per hour. The speed on the last kilometer is only restricted by the presence of potholes on that kilometer.
Winnie loves driving fast, almost as much as he loves honey. Therefore, he wants to reach the tree as quickly as possible while keeping his car intact. He has asked you to figure out the fastest time he can make the trip.
Input
The first line of the input contains two integers n and k (1 ≤ n, k ≤ 1000)—the length of the road and the maximum speed allowed on a pothole section, respectively. The next line contains n numbers, each either 0 or 1—the road's description. A 0 indicates a smooth kilometer that can be driven at any speed, while a 1 indicates a kilometer with a pothole, where the speed must not exceed k kilometers per hour.
Output
Output one real number—the minimum number of hours it will take Winnie-the-Pooh to reach the tree. The answer should be accurate to within 10^{-6} of the correct value.