Problem Description
The discovery of a remarkable new insect, the Lampyridae Teleportae, more commonly known as the teleporting firefly, has sparked a no-less-remarkable number of ways to try to catch them. Rather than flying, the Lampyridae Teleportae teleports from spot to spot by warping space-time. When it stops between teleports, it hovers for a moment and flashes its light in search of a mate. So, even though they only come out after dark, it's easy to observe them, but very difficult to catch them. Fortunately for the Association for Catching Lampyridae (ACL), student members of the Association for Cool Machinery (ACM) recently developed the world's first teleporting tennis shoes. The tennis shoes are efficient enough that, when a
Lampyridae Teleportae is spotted by its flash, there is always time to teleport once before the firefly itself teleports off to another location, but there is never time to teleport twice in a row before the firefly teleports away. The tennis shoes have a maximum teleport range, however, depending on how well their flux capacitor is constructed, so it's not always possible to catch a Lampyridae Teleportae with just a single teleport. The
most efficient catching method is to remain in place until a firefly flashes, and to then teleport in a straight line directly toward it, subject to the limitation of the maximum range of ones tennis shoes, in an attempt to get close enough to catch it. If you don't get close enough, you wait for the next flash, teleport towards it again, and repeat, until you either catch it or it's gone.
For this programming problem you will simulate this procedure for catching teleporting fireflies with a few simplifying assumptions:
(1) We will be chasing only one firefly at a time.
(2) Firefly chasing will take place in two dimensions where all units are considered to be yards.
(3) The firefly is "caught" if the chaser can manage to come within one yard of the firefly.
(4) The chaser's movement toward a firefly is always in a straight line from his or her current location directly toward the flash; if the range of the chaser's tennis shoes prevents getting close enough to catch the firefly, the chaser will always teleport the maximum range possible (thus, although the chaser always starts at integer coordinates, it is possible and likely that any or all of the chaser's locations after the first teleport will be at non-integer coordinates).
The input will consist of several chase scenarios. For each scenario you will be given the maximum range in yards of the chaser's teleporting tennis shoes, the chaser's starting location, and a list of one or more flash
locations for the firefly being chased. For each chase scenario your program will output a single line indicating either the flash location where the firefly was caught, or a message noting that the firefly was never caught.

Input
The first line of a chase scenario contains three numbers, delimited by a single space, in the following order: the maximum range in yards of the chaser's teleporting tennis shoes, the starting x-coordinate of the chaser, and the starting y-coordinate of the chaser. The maximum range will be a positive integer from 1 to 1000. The x and y values for the starting coordinates will be integers from 0 to 1000. The remaining lines of
an input scenario contain two integers each, an x-coordinate and a y-coordinate, again delimited by a single space. These are, in order of appearance, the locations where the firefly flashes. All coordinate values range from 0 to 1000. A line specifying a value of -1 for both x and y terminates the list, at which point we consider the firefly to disappear never to be seen again. Note that a firefly might be caught at a flash location prior to end of the list; in this case the rest of the flash locations listed in the input for the current chase scenario should simply be ignored.
The next input scenario begins on the line immediately after the last line of the preceding scenario. An input scenario that specifies 0 (zero) as the maximum range of the chaser will terminate the input.

Output
Every output line will be either:
(1) "Firefly N caught at (x,y)", where N is the input scenario number starting with 1, and (x,y) is the last location the firefly flashed before it was caught; or
(2) "Firefly N not caught".

Sample Input
2 0 0
3 3
4 4
5 5
6 6
7 7
-1 -1
2 0 0
3 3
5 5
7 7
-1 -1
10 50 50
50 62
40 55
30 55
45 45
50 50
55 55
50 50
-1 -1
0 0 0

Sample Output
Firefly 1 caught at (6,6)
Firefly 2 not caught
Firefly 3 caught at (50,50)

0

【C语言】求两个坐标点之间的距离

#include #include #include typedef struct Point {     int x;     int y;     int z; }Point;  //定义一个坐标结构体 double Distance(Point *p1,Point *p2) {     int x=(p1->x)-(p2->x);     int y=(p1->y)-(p2->y);

【C语言】用递归函数实现n^k

#include #include struct point { float x; float y; }stu1,stu2; int main() { scanf("%f%f",&stu1.x,&stu1.y); scanf("%f%f",&stu2.x,&stu2.y); float t1,t2; t1=(stu1.x+stu2.
GPS卫星坐标计算

c语言练习题 3-2 计算矩形面积
3-3 矩形面积计算 #include int max(int a,int b) { if(a>b) { return a; } else { return b; } } int min(int a,int b) { if(a<b) { return a; } else { return b; } } int main() { int Ax1
c++求两坐标点的的距离
#include #include #include using namespace std; /* 从键盘输入两个点的坐标值，计算两点间距离。 要求：定义一个CPoint类，属性包括X，Y坐标值。 */ /* double cpointer(double x,double y); int main(int argc, char *argv[]) {  int l;

OC-百度地图计算两个坐标之间的距离
BMKMapPoint point1 = BMKMapPointForCoordinate(CLLocationCoordinate2DMake(coorStart.latitude,coorStart.longitude));     BMKMapPoint point2 = BMKMapPointForCoordinate(CLLocationCoordinate2DMake(coorEnd

// -    创建用来存储point的数组     CGPoint point[3] = {{100,180},{38,90},{190,39}};
php中坐标之间的距离
<?php define('EARTH_RADIUS', 6378.137);//地球半径 define('PI', 3.1415926); /** * 计算两组经纬度坐标 之间的距离 * params ：lat1 纬度1； lng1 经度1； lat2 纬度2； lng2 经度2； len_type （1:m or 2:km); * r

c#编程环境下的测量程序，windows窗口化的。只是自己上课的一个作业。 创建了一个地面点的类，该类可以实现诸如坐标正反算、方位角计算的功能。 主要的是把这种方法放在了窗口当中。用了textbox，richtextbox，个人感觉比较有收获的就是提取出来textbox中的数字值，和弧度化角度

C语言编写的实现高斯坐标正反算

C语言编写的五子棋游戏 设计思路

package yaz; import java.io.*; public class Gobang{ private static final int X = 10; private static final char c = (char)43; private String[][] panStr = new String[X][X]; //初始化棋盘，用“+”表示初始棋盘
GPS卫星坐标计算代码（C++)

skyline软件体系及工作流程
skyline软件系列平台提供了从数据生产、编辑到网络发布的一整套的成熟的商业解决方案。无论是单机环境还是网络环境，用户都能够根据自己的需求进行功能定制，建立起自己的三维地理信息系统。本文主要从skyline软件的工作流程出发，介绍一下skyline的软件体系结构。一、数据生产----TerraBuilder     我们知道，要建立起一个真正的三维地理信息系统，首先必须要有D
C/C++已知坐标求角度（函数atan和atan2）
atan函数和atan2函数求角度的区别： 已知两点坐标求角度时，atan函数求角度时无方向（矢量），atan2函数求角度时有方向（矢量）。 atan：-90~90度 atan2：-180~180度 例如：a（3,1），b（4,2）  方向ab              求直线角度（与水平坐标线），atan：45°

Android通过颜色矩阵（ColorMatrix）和坐标变换矩阵（Matrix）处理图片

C语言中关于数组和结构体
C语言字符串数组在使用的过程中的注意事项： 1. 字符串数组范围的选择 在C语言中使用数组的时候要时刻注意数组的范围以及在程序运行过程中是否会出现数组越界的情况，本篇说明根据在编写PAT乙级1004题目的代码时所犯下的错误进行理解数组。   题中需要定义学号和姓名的数组且学号和姓名不超过10个字符，我的错误定义数组范围为: char name[10]; char course[10];

class Point{ double x,y,z;//先生成三个坐标，可以定义 //构造方法 public Point(double _x,double _y,double _z) { x= _x;//把_x的值赋给x y= _y;//把_y的值赋给y z= _z;//把_z的值赋给z } //设置三个点的坐标
Excel测量程序集

Mysql sql 计算两个坐标之间的距离
Mysql sql 计算两个坐标之间的距离   赤道半径：6378.137km 查询结果为km SELECT id,( 6378.137 * 2 * ASIN( SQRT( POW( SIN( ( RADIANS(当前纬度latitude)- RADIANS(数据库中存储的目标纬度latitude) )/ 2 ...

1．每个进程有一个作业控制块（JCB）表示。进程控制块包含如下信息：作业号、作业到达时间、作业要求服务时间、 等待时间、 开始运行时间、 结束运行时间、周转时间、带权周转时间、优先权和是否已经完成； 2. 设置一个作业数量num； 3．由于在单道批处理系统中，作业一投入运行，它就占有计算机的一切资源直到作业完成为止，因此调度作业时不必考虑它所需要的资源是否得到满足，它所占用的CPU时限等因素； 4．分别采用先来先服务（FCFS），最短作业优先（SJF）、响应比高者优先（HRN）的调度算法对输入进程进行调度； 5．先来先服务（FCFS）对先来的作业优先处理； 6．最短作业优先（SJF）对已就绪作业进行短程序优先服务； 7．响应比=（等待时间+需要服务时间）/需要服务时间，响应比高者优先（HRN）是对已就绪作业进行响应比高者优先服务，以免一些程序长时间不能被执行； 8．对每种调度算法都要求打印每个作业开始运行时刻、完成时刻、周转时间、带权周转时间，以及这组作业的平均周转时间及带权平均周转时间，以比较各种算法的优缺点。