Astronomer
문제
The astronomer has a passion for stargazing. In particular, he gets immense pleasure out of gazing at stars simultaneously through his telescope. Building a telescope with radius costs kroner. A newly built telescope will point exactly at the origin . Moving it to point somewhere else also takes effort; shifting the telescope a distance of units incurs a cost of kroner. The astronomer can observe all stars at distance at most from where the telescope points.
How much does it cost to build and move a telescope that allows stars to be observed at once?
All coordinates and distances are given in the Euclidean plane.
Here is an example with stars at positions , , and . The shaded area shows a telescope of radius pointing at covering two stars; this costs kroner and is an optimal solution to sample input . The image also shows optimal solutions to sample inputs , , and .
입력
The first line consists of four integers: the number of stars the astronomer wants to observe, the number of stars in tonight's sky, the shifting cost , and the telescope building cost . Then follow lines, where the th line contains the integer coordinates and of the th star.
출력
A single real number: the minimum number of kroner that the astronomer needs to spend.
예제
예제 1
2 3 1000 500 0 0 2 0 3 1
1000.0
예제 2
2 3 500 3000 0 0 2 0 3 1
3387.277541898787
예제 3
2 3 250 750 0 0 2 0 3 1
1000.0
예제 4
2 3 0 500 0 0 2 0 3 1
353.5533905932738
예제 5
3 4 0 10 0 0 10 0 5 10 5 5
50.0