Java教程

第六篇英语翻译

本文主要是介绍第六篇英语翻译,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

重点单词:

1. radar n.雷达

2.installation n.安装

出处:https://acs.jxnu.edu.cn/contest/22/board/challenge/E

Radar Installation

描述:

Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea side. And any radar installation, locating on the coasting, can only cover d distance, so an island in the sea can be covered by a radius installation, if the distance between them is at most d. 假设海岸线是一条无限长的直线。陆地在海岸线的一边,海洋在另一边。每个小岛都是位于海边的一个点。而任何位于海岸上的雷达装置只能覆盖d距离,因此,如果它们之间的距离不超过d,那么海上的岛屿可以被半径装置覆盖。

We use Cartesian coordinate system, defining the coasting is the x-axis. The sea side is above x-axis, and the land side below. Given the position of each island in the sea, and given the distance of the coverage of the radar installation, your task is to write a program to find the minimal number of radar installations to cover all the islands. Note that the position of an island is represented by its x-y coordinates. 我们使用笛卡尔坐标系,将海岸线定义为x轴。海侧在x轴上方,陆侧在x轴下方。考虑到每个岛屿在海上的位置,以及雷达装置的覆盖距离,您的任务是编写一个程序,以找到覆盖所有岛屿的雷达装置的最小数量。请注意,岛的位置由其x-y坐标表示。

Figure A Sample Input of Radar Installations


输入:

The input consists of several test cases. The first line of each case contains two integers n (1<=n<=1000) and d, where n is the number of islands in the sea and d is the distance of coverage of the radar installation. This is followed by n lines each containing two integers representing the coordinate of the position of each island. Then a blank line follows to separate the cases.

The input is terminated by a line containing pair of zeros

输入:

输入由几个测试用例组成。每种情况的第一行包含两个整数n(1<=n<=1000)和d,其中n是海上岛屿的数量,d是雷达装置的覆盖距离。然后是n行,每行包含两个整数,表示每个岛位置的坐标。然后,一个空白行将案例分开。

输入端由包含一对零的行终止


输出:

For each test case output one line consisting of the test case number followed by the minimal number of radar installations needed. "-1" installation means no solution for that case. 对于每个测试用例输出,一行由测试用例编号和所需的最小雷达安装数量组成。“-1”安装意味着在这种情况下没有解决方案。

样例输入:

3 2
1 2
-3 1
2 1

1 2
0 2

0 0

样例输出:

Case 1: 2
Case 2: 1
这篇关于第六篇英语翻译的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!