Le Tour de France

0.60

The organizers of Le Tour de France (the country where a Big Mac is Le Big Mac) are determined to put an end to the continuous cases of doping in the race. They have recently received the results of a detailed study, carried out by the French National Center for Scientific Research (CNRS), which will help them to determine if a cyclist taking part in the race has been using illegal substances or not.

This study draws a series of surprising conclusions:

  0.40

The organizers of Le Tour are considering to implement an automatic device to shoot to kill with a sniper riffle any cyclist crossing the finish line in a time judged impossible according to the stage profile and the measured starting amount of cycling mana. Please help Le Tour to get rid of those cheaters.

Input

Input starts with the number of points 2n10002 \le n \le 1000 of the description of the stage profile. Follow nn pairs of natural numbers 0di,hi100000 \le d_i, h_i \le 10000. They give, for the ii-th control point, the horizontal distance in kilometers from the start of the stage, and the height above the sea level in meters, respectively. The pairs are strictly sorted by distance. The first pair corresponds to the starting line and hence has d1=0d_1 = 0, whereas the last pair corresponds to the finish line. The angle of the road between two contiguous control points is constant.

After the profile description comes 0c500000 \le c \le 50000, the number of cyclists taking part in the race. Follow cc lines with a real number MjM_j and three natural numbers hj,mj,sjh_j, m_j, s_j giving, for the jj-th cyclist, his starting amount of cycling mana 0Mj2000 \le M_j \le 200 and his time to finish the stage, decomposed in hours, minutes and seconds. Assume 0hj10000 \le h_j \le 1000 and 0mj,sj<600 \le m_j, s_j < 60.

Output

For every cyclist, print “SHOOT” or “PASS” according to whether the cyclist should be shoot for using doping substances or not. The cases have no precision issues.

Problem information

Author: Edgar Gonzàlez

Generation: 2026-01-25T11:20:09.652Z

© Jutge.org, 2006–2026.
https://jutge.org