编程介的小学生 2019-09-14 21:54 采纳率: 20.5%
浏览 43

The widest road 是怎么代码编写

Problem Description
There were two families in the village — family A and family B, while these two families didn’t get along well with each other. Now the head of the village decided to make a road through the village and it must be straight, for a straight line makes the way shortest and meanwhile, saves the cost. At that time, the heads of the two families proposed, because they didn’t want their own families live separated along the two sides of the road, thus it might decrease the solidarity of family. Besides, the two families were antipathetic to each other; neither wanted to live together with the other in a same side of the road. Then it made the village head in a pickle, he hoped the road to be as wide as possible. So what’s the possible maximal width of this road?
In order to simplify the problem, let’s regard the living place of each family member is just a point.

Input
There are several test cases in the input.

The first line of each input contains n and m (1 ≤ m,n ≤ 1000). As for the following n lines, there are two numbers in every line, representing the living places of A family members. And the following m lines represent the living places of B family members.

Output
The output numbers of each line are the maximal width of the road (retain four decimal), while if it’s impossible to make such a road, then just output 0.0000.

Sample Input
3 3
0.0 0.0
1.0 0.0
0.0 1.0
4.0 0.0
5.0 0.0
4.0 1.0

Sample Output
3.0000

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥50 安卓adb backup备份子用户应用数据失败
    • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
    • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
    • ¥30 python代码,帮调试
    • ¥15 #MATLAB仿真#车辆换道路径规划
    • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
    • ¥15 数据可视化Python
    • ¥15 要给毕业设计添加扫码登录的功能!!有偿
    • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
    • ¥15 微信公众号自制会员卡没有收款渠道啊