KöMaL - Középiskolai Matematikai és Fizikai Lapok
A lap

Rendelje meg a KöMaL-t!

VersenyVizsga portál


Matematika oktatási portál

Problems in Information Technology, March 2007

Please read the rules of the competition.

Problems with sign 'I'

Deadline expired on 16 April 2007.

I. 154. Make a program that generates a picture gallery: it takes images of a folder and produces a web page with the gallery in the same folder.

First your program reads the full path of the folder from the command line (for example, i154 c:\mypictures\web\today\), then makes a list of its files (subfolders should be ignored). The folder contains only .gif, .png and .jpg extensions, but every file has two copies: a larger and a smaller one. The smaller copy is a thumbnail image, its name begins with a letter ``k'' but the name and extension are otherwise identical to the original file.

Then, in the same folder, your program generates one index.html file and several .html files, each corresponding to a picture having the same name. The page index.html has the thumbnail images in four columns: they are in fact all links to the corresponding .html pages containing the original pictures. The pages with the original images should also contain a left and a right arrow (both being links to the previous and next original images in the list), further, a small icon referring back to the thumbnail images.

The source code of the program (i154.pas, i154.cpp, ...) generating the HTML pages should be submitted. We also take into account the design of the web pages generated.

(10 points)

Solution (in Hungarian)

I. 155. Zeno decides to make use of a spreadsheet, since he tends to forget about birthdays. The sheet issues a reminder one week before the event. Beginning with the second line, Zeno has already entered the names and birthdays into the first two columns of the sheet. Now he asks for our help to finish the sheet.

He would like to have the actual date in cell A1. The second cell of the same row should contain the number of days to the nearest birthday and the name(s) of the person/people having birthday then, provided that this event occurs within a week. If there are more people, their names should be separated by commas. If there is no birthday in the near future, that cell should be left empty.

The sheet (i155.xls, ...) is to be submitted.

(10 points)

Solution (in Hungarian)

I. 156. We obtain interesting patterns if regular polygons of different size are drawn on the sides of each other.

Prepare your program that draws an n-sided regular polygon (3\len<10) onto each side in the interior of another n-sided regular polygon. Trisection points of the sides of the larger polygon define sides of the smaller polygons. Then apply this procedure iteratively k (1<k<10) times to each of the new polygons. The parameters n and k are read from the command line ( i156.exe 4 85 in the second example). The image should be placed in the middle of the screen, in the largest size for all details to be visible.

The source code of the program (i156.pas, i156.cpp, ...) should be submitted.

(10 points)

Solution (in Hungarian)

Problems with sign 'S'

Deadline expired on 16 April 2007.

S. 25. L-shaped tiles are sold in a furniture shop. Every tile has one corner element, at least one but at most three line elements and two terminating elements at both ends. The first column of the following table contains the line elements, the following two columns the possible corner elements, while the last two columns the terminating elements together with their ASCII codes.

Write a program that asks for sidelengths of a rectangle in the command line (for example, s25.exe 4 2 in the case of a 4×2 rectangle), then prints tiling of the full rectangle when the smallest possible number of tiles are cut. The output of your program (on a text screen) is an arrangement of the tiles in each line separated by spaces: first, by using the given characters then the corresponding ASCII codes. The result for the previous 4×2 rectangle is

As a further example, a possible tile is

And the tiling of a 2×5 rectangle (without cutting any tiles):

Tiling of a 6×6 rectangle (again, without any cutting):

The source code of the program (s25.pas, s25.cpp, ...) and a short documentation (s25.txt, s25.pdf) are to be submitted.

(10 points)

Solution (in Hungarian)

Send your solutions by e-mail to:


Támogatóink:   Ericsson   Cognex   Emberi Erőforrás Támogatáskezelő   Emberi Erőforrások Minisztériuma   Nemzeti Tehetség Program    
MTA Energiatudományi Kutatóközpont   MTA Wigner Fizikai Kutatóközpont     Nemzeti
Kulturális Alap   ELTE   Morgan Stanley