编程介的小学生 2017-11-21 11:54 采纳率: 0.9%
浏览 623
已采纳

Splendid Moment Collector

Problem Description
Being a traveler is always an exciting and memorable experience, especially for iSea. He is a crazy Splendid Moment Collector, not only he likes the wonderful scenery very much, what’s more, he wants himself go through the moment at the very time!

Our beautiful country has N scenic spots, which can be treated as some single points with a coordinate (Xi, Yi), and as a clever prophet, iSea knows the splendid moment of each spots Ti, and he must arrive this spot exactly at Ti time if he want to collect this spot’s splendid moment.
iSea has a speed of V, while travelling between spots, obviously he will choose the shortest path: the straight line. In the beginning, he can choose any spot to start his journey, but in the end, he must return the spot he chooses at first.
Perfectionist pushes himself to gather everything all the time, so does iSea. However, life can’t stand by you the whole days. So iSea wonders the maximum number of splendid moments he can collect, and in all of these journeys have the maximum number, he expects to choose the one has the shortest distance.

Input
The first line contains a single integer T, indicating the number of test cases.
Each test case begins with two integers N, V. Their meanings are the same as the description.
Then N lines follow, each line contains three integers Xi, Yi, Ti, their meanings are also mentioned in the description.

Technical Specification

  1. 1 <= T <= 50
  2. 1 <= N <= 100
  3. 1 <= V <= 1000
  4. 1 <= Ti <= 100000
  5. 1 <= Xi, Yi <= 10000

Output
or each test case, output the case number first, then the maximum number of splendid moments iSea can collect, then the minimum distance among all the eligible journeys, rounded to three fractional digits.

Sample Input
3
2 2
1 1 1
1 3 2
3 2
1 1 1
2 2 2
1 3 2
3 2
1 1 1
2 2 2
1 3 3

Sample Output
Case 1: 2 4.000
Case 2: 2 2.828
Case 3: 3 4.828

  • 写回答

1条回答 默认 最新

  • threenewbee 2018-08-02 15:46
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵