QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 512 MB

# 170. Shortest Bridge

Statistics

Samples

Input 1

200 500 800 500
3
400 0
450 500
400 1000
3
600 0
550 500
600 1000

Output 1

100 600

Input 2

300 300 700 100
5
300 0
400 100
300 200
400 300
400 1000
4
700 0
600 100
700 200
700 1000

Output 2

200 541.421356237

Input 3

300 400 700 600
2
400 0
400 1000
2
600 0
600 1000

Output 3

200 482.842712475

Input 4

200 500 800 500
3
400 0
450 500
400 1000
5
600 0
550 500
600 100
650 500
600 1000

Output 4

100 1200.326482915