Land surveyor’s job

The job of a land surveyor has been substantially changed with the ar- rival of GPS and satellite imaging. However, the traditional tools of a land surveyor still are a theodolite, for measuring angles, and a measur- ing tape for measuring distances. Although in real land surveying we are concerned with three dimensions, for this problem we will restrict ourselves to a plane. The backbone of any land survey is a traverse consisting of a se- quence of n stations numbered 1, 2, . . . , n. Stations are chosen by some criteria that do not concern us here. For each station i two measure- ments are taken: • the length of the forward shot, i.e. the distance from station i to station i + 1, in case of station n this is the distance to station 1, • the angle between the back shot and the fore shot measured clockwise; this is the angle from the segment (i, i − 1) to the segment (i,i + 1) measured clockwise. In case of station 1, this angle is entered as 0 since the n-th station is not known in advance. For station n this angle is the angle between the segments (n, n − 1) and (n, 1). For all stations other than station 1 this angle is non-zero. For a given traverse, when locations of stations i and i + 1 are available we can compute the location of station i + 2. In consequence, given a traverse and actual locations of stations 1 and 2 we can calculate the locations of all other stations. However, because of the inaccuracy of theodolites and measuring tapes, the results of our calculations are approximate. Therefore, after computing locations of stations n − 1 and n we can compute the location of station 1 and compare it to the assumed actual location. We say that a traverse is acceptable if the distance between the actual location of station 1 and its location as calculated from the traverse is less than 0.1% of the total length of the traverse. Input The input consists of a number of cases. The data of each case appears on a number of input lines, the first of which contains a non-negative integer n giving the number of the stations in a traverse, 3 ≤ n ≤ 1000. The following n lines contain the distance and angle measured for each station in increasing order of their numbers. Except for station 1, all angles are specified in degrees, minutes and seconds in the format shown in the sample input. Note that the angle for station 1 is shown as 0. Input is terminated by a line with n equal to 0. Output For each case of input, output one line stating whether the traverse of this case was ‘Acceptable’ or ‘Not acceptable’.

2/2 Sample Input 4 10 1 90d00'00" 0.999 90d00'00" 1 90d00'00" 4 10 0 10 270d00'00" 9.95 270d00'00" 10 270d00'00" 0 Sample Output Acceptable Not acceptable