Time limit
2s
Memory limit
128 MB
Yoonhwa is a travel guide who leads tourists on a bus. One day, she is guiding N tourists.
During a one-hour lunch break, each tourist goes wherever they want. At the end of the break, no tourist has returned to the bus. Yoonhwa starts from the bus, must meet every tourist, tell them to return immediately, and then return to the bus herself.
At time t=0, the bus is at the origin (0,0). Each tourist keeps moving in a straight line from their current position with their own speed and direction. When Yoonhwa meets a tourist, that tourist immediately changes direction and moves straight back to the bus at the same speed.
Find the minimum possible time at which everyone, including Yoonhwa, has arrived back at the bus.
The first line contains the number of tourists N (1≤N≤8).
The second line contains Yoonhwa's speed as a decimal number.
Each of the next N lines contains four decimal numbers xi, yi, vi, and ai.
Print the minimum time, rounded to the nearest integer.
The answer is guaranteed to be at most 106.