Polish version    English version  
  About Olympic -> Problems -> I OI 1993/1994


 News
 About Olympic
About contest
Problems
I OI 1993/1994
II OI 1994/1995
III OI 1995/1996
IV OI 1996/1997
V OI 1997/1998
VI OI 1998/1999
VII OI 1999/2000
VIII OI 2000/2001
IX OI 2001/2002
X OI 2002/2003
XI OI 2003/2004
XII OI 2004/2005
XIII OI 2005/2006
XIV OI 2006/2007
XV OI 2007/2008
Problems archive
 History of OI
 OI books
 National team
 Olympic camps
 Photo gallery
 Links
 SIO
 MAIN
Niebieskie ksi.eczki
I Olympiad in Informatics 1993/1994

Task: SPO
Author: Piotr Chrz±stowski-Wachtel
Sponsor

I stage contest  

Since childhood a swimmer Daniel Waterproof has been being sponsored by his uncle, a rich businessman. At the end of Daniel's swimming career his uncle has decided to fund a special prize for him. Daniel has been storing in a computer all the consecutive times scored while training as well as during competitions in his crown contest - 50 m free style, so his uncle has devised that the amount of the prize would depend on the length of the longest decreasing sequence of scores which can be found in the consecutive data. The prize amount in dollars would be hundred times greater than the length of this sequence.

The input data is a nonempty sequence of consecutively scored results during the whole Daniel's career. The scores are measured in seconds with one thousandth of a second precision. Every score is a number from the closed interval [20, 30], having exactly three digits after the decimal point. The consecutive scores are separated by a space or a single end-of-line character.

The answer is an integer equal to the amount of the prize in dollars or the word NONSENS ("nonsense"), if the data file is not correct, i.e. does not meet the above conditions.

Example

For the input file:

22.155 23.252 22.586 22.450 23.327 22.228 22.087 23.091 22.190
22.140 22.057 22.123 22.359 22.190 22.140 22.523 22.384 22.488
23.201 23.050
containing twenty consecutive scores the answer is number 700, for the maximal length of decreasing sequence of the scores equals 7. One can even indicate two such decreasing sequences of length 7. They are made of the scores:

2nd, 3rd, 4th, 6th, 9th, 10th and 11th:

23.252 22.586 22.450 22.228 22.190 22.140 22.057,

and

2nd, 3rd, 4th, 6th, 9th, 10th and 12th:

23.252 22.586 22.450 22.228 22.190 22.140 22.123.

For the input file:

22 22.4357 22.5
the answer is the word NONSENS, for every one of the three scores has been written not meeting the given rules.

Task

Write a program, that successively for every data set from a file SPO.IN generates a correct answer: an integer number or the word NONSENS, and writes it to a file SPO.OUT.

The source text of the program should be written in a file named SPO.???, where ??? are substituted by a sequence of letters appropriate for the programming language used.

The executable program should be named SPO.EXE.




Print friendly version