Order KöMaL! Competitions Portal

# Problems in Information Technology, February 2008

## Problems with sign 'I'

Deadline expired on 17 March 2008.

I. 178. A certain river freezes up, if the temperature is at most -5 oC during at least 5 consecutive days. Make a spreadsheet application that creates random temperature data then decides whether the river will freeze up or not in that month.

In the first 31 rows and 6 columns of the Temperature'' worksheet, temperature data corresponding to the 31 days of the month should appear, recorded at 2 A.M., 6 A.M., 10 A.M., 2 P.M., 6 P.M. and 10 P.M. each day. Temperature values are integers between -15 oC and +5 oC. These values are random numbers, but on each day the maximum should occur at 2 P.M. and the minimum at 2 A.M. It is further required that the difference between two consecutive temperature values (including the last one on a certain day and the first one on the next day) should be at most 5 oC.

Your program should fill cells A1:F31 with random values (but with different random values if the worksheet is recomputed) according to the criteria above. Cell H5 should contain Yes'' or No'' indicating whether the river freezes up. If Yes'', then H6 should contain the first day when it is already frozen.

Your worksheet (i178.xls, i178.ods, ...) and a short documentation (i178.txt, i178.pdf, ...) should be submitted, containing a short description of your solution, further, the name and version number of the spreadsheet application.

(10 points)

I. 179. Create a web page in HTML 4 format with CSS style sheet describing your neighbourhood. Use images and links to introduce your town, a part of your city, or your district and its main show-places. Institutions of local government, theaters, sport centers should be arranged in a table, containing images of size approx. 150×100 pixels in the first column, then some interesting sentences describing that object in the second column. At the same time, images should be links to web pages of the corresponding institutions (opening in a new window). When the mouse pointer hovers above an image, the image should become more faint. Your page should be nicely formatted using a CSS sheet.

Your work should contain an index page, a style sheet and the necessary images. These files should be made available on the Internet. The HTML file and the style sheet should be checked against errors using tools at http://www.w3.org/ page. The address of your web page should be submitted.

(10 points)

I. 180. Place 8 rooks on a chessboard such that none of them attacks any other. Half of the rooks should be put on white squares. Your program should give all possibilities. Squares of the chessboard are encoded as usual. Two arrangements are considered different if there is at least one square containing a rook on the first board but not on the second. Possible arrangements should be written into a text file in an arbitrary order. (The name of this file is given as a command line argument to your program.)

The description of a particular arrangement should consist of 10 lines: the first line contains the number of this arrangement, then 8 lines containing 8 X'' letters (as rooks) and 56 .'' characters (as empty squares) (see the Figure), finally an empty line.

X.......
.X......
...X....
..X.....
......X.
....X...
.......X
.....X..

The source code of your program (i180.pas, i180.cpp, ...) and a short documentation (i180.txt, i180.pdf, ...) should be submitted, containing the main ideas of your solution and the name of the developer environment to run the program.

(10 points)

## Problems with sign 'S'

Deadline expired on 17 March 2008.

S. 33. Let us consider the following game. You have to roll a rectangular box of size 2×1×1 along a grid of unit squares, from a given starting square to a final one. Both in its initial and final positions the box stands on the starting/final square on its 1×1 face. At the end of each roll, the box should rest on one of its faces. The rotations are encoded with letters J (=right), B (=left), F (=upper), L (=lower), where J'', for example means that the box is rotated by 90o along its right edge if seen from above. The box is allowed to rest only on a selected set of squares.

Write your program to decide whether it is possible to solve the game. If yes, your program should also give the shortest sequence of rotations from the starting to the final position of the box. The shape of the game board is read from a file (its name is given as the first command line argument to your program) and the output is written to another file (with name in the second command line argument).

The first two lines of the input file contain two integers separated by a space: the maximal width S and height M of the board (2S,M100). Each of the following M lines then contains S digits (without spaces): 0, if that square is not part of the game board; 2, if that square is the starting position; 3 for the final position and 1 otherwise.

The solution should be encoded as a single line of letters J, B, F or L. If there is no solution, print Nem megoldhato''. (In the example, BE means input, while KI means output.)

The source code of your program (s33.pas, s33.cpp, ...) and a short documentation (s33.txt, s33.pdf, ...) should be submitted, containing the main ideas of your solution and the name of the developer environment to run the program.

(10 points)

### Send your solutions by e-mail to:

solutions.informatics@komal.hu

 Our web pages are supported by: ELTE Morgan Stanley