|
||||||||||
Tracing FairyTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 146 Accepted Submission(s): 8 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
Sample Output
Hint In the first group, obviously, there is a car teleporting but not having a uniform motion in a straight line in a given moment in the third photo. In the second one, two cars both have a uniform motion in a straight line along the positive direction of Y axes at a speed of moving a unit in unit time. Source | ||||||||||
|