II Olympiad in Informatics 1994/1995
|
Task: TRO
|
Author: Piotr Chrz±stowski-Wachtel
|
II stage contest |
In a finite sequence of positive integers not greater than a billion, representing lengths of line segments, we want to find three numbers such that one can build a triangle from segments of such lengths.
If there exist many triples of line segments of lengths written in the file TRO.IN such that one can build a triangle from them, then your program should find and write only one (arbitrary) of them.
The data in the file TRO.IN are written correctly and your program need not verify that.
105 325 55 12555 1700 0in the file TRO.OUT there should be one word:
NIE
For the file TRO.IN:
250 1 105 150 325 99999 73 0the following three numbers in the file TRO.OUT are a sample correct solution:
250 105 150
Your program should look for the file TRO.IN in the current directory and create the file TRO.OUT also in the current directory. The source file containing the program written by you should be named TRO.???, where ??? are substituted by at most three-letter abbreviation of the programming language used. The same program in an executable form should be written in a file TRO.EXE.