The role of Keqing, Yuheng of the Liyue Qixing, is to manage real estate and construction in Liyue.
Today Keqing decides to leave her office, and visit two places - Chasm, and Jueyun Karst - to make sure the building progress there is at a reasonable pace.
The location of Keqing’s office and the two places to visit can be denoted as three points on a 2D Cartesian coordinate system.
Keqing’s office, the start point, is Located at Point O (0,0).
Chasm is located at Point A (a,b).
Jueyun Karst is located at Point B (2a,0).
Keqing plans to visit Chasm first and then go to Jueyun Karst. Because Keqing is an experienced land overseer, she does not need to be at the exact location to do her job. She can finish the visit if the distance between her and the target point is no greater than R.
Please help Keqing find the shortest path to visiting Chasm and Jueyun Karst.
Input
There are T test cases in this problem.
The
F Land Overseer
本文讲述了璃月七星之一的刻晴巡查房地产建设的故事。刻晴从办公室出发,需要依次访问两个地点:赤王遗迹和绝云间。这些位置可以用二维笛卡尔坐标系表示。为了完成巡查,刻晴只需在距离目标地点不超过R的范围内即可。问题求解最短巡查路径的长度。题目属于计算几何范畴,需要判断半径与y坐标的关系来确定路径选择。
摘要由CSDN通过智能技术生成