|
|||||||
|
Polygons
Two players take part in the game polygons. A convex polygon with n vertices divided by
n-3 diagonals into n-2 triangles is necessary.
These diagonals may intersect in vertices of the polygon only. One of the triangles is black and the
remaining ones are white. Players proceed in alternate turns. Each player, when
its turn comes, cuts away one
triangle from the polygon. players are allowed to cut off triangles along the given
diagonals. The winner is the player who cuts away the black triangle. TaskWrite a program which:
Input
The first line of the input file GRA.IN contains an integer n, 4 <= n <=
50000. This is the number of vertices in the polygon. The vertices of the polygon
are numbered, clockwise, from
0 to n-1. OutputThe output file GRA.OUT should have one line with the word:
ExampleFor the input file GRA.IN: 6 0 1 2 2 4 3 4 2 0 0 5 4 the correct answer is the text file GRA.OUT: TAK Your program should look for the file GRA.IN in the current directory and produce the output file GRA.OUT in current directory too. The file containing source code of your program should have a name GRA.???, whereas you should put three-letter abbreviation of used programming language name instead of ???. The same program in executable form should be written in file GRA.EXE |