编程介的小学生 2017-06-11 16:25 采纳率: 20.5%
浏览 878
已采纳

Tracing Fairy

Problem Description
Fairy Kate was going to visit man’s world. She informed her friend Conan but she didn’t want him to pick her up, but to find her. She told Conan that she was driving a car in the town, but at a given moment, she would move the car from one place to another with teleporting magic and these two places were quite far away from each other. If Conan could find her, she would play with him. It was rather difficult for Conan. He got a series of photos of every block from uncle Maoli. Each group of photos was taken every centisecond in a very short period, in which, there were a lot of cars. While in some groups, there was a car teleporting in a given time and in other time other cars as well as the Fairy’s all had a uniform motion in a straight line along the X or Y axes. However, Conan really felt puzzled, so he asked you, his friend Heiji Hattori, for help. Can you find in which moment the Fairy’s car was teleporting but not having a uniform motion in a straight line? The truth is one and only!

Input
Input several groups until you deal with EOF.

In the first line of each group of data, there are two integers, n and m, (5 =< n <= 200,1 =< m <= 200) n standing for the number of photos in this group, m for the number of cars in these photos. And then, in n groups, each photo’s data is given according to time sequence (the number of photos is 1 to n) and each group has m lines, each line two numbers which respectively represents a car’s X and Y axes (they are not given according to car’s numbers).

Output
If in a given moment in photos, it is obvious that there is a car teleporting but not having a uniform motion in a straight line, then output: "The fairy use magic at photo x."(X is the number of photos, 2 =< x <= n) Or else, output: "The fairy did not appear on this group of photo."

Sample Input
5 2
1 1
2 2
1 2
3 2
2 8
4 2
2 9
5 2
2 10
6 2

5 2
1 3
3 2
3 3
1 4
1 5
3 4
3 5
1 6
1 7
3 6

Sample Output
The fairy use magic at photo 3.
The fairy did not appear on this group of photo.

  • 写回答

1条回答 默认 最新

  • devmiao 2017-06-30 15:43
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥15 绘制多分类任务的roc曲线时只画出了一类的roc,其它的auc显示为nan
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?