Mathematical and Physical Journal
for High Schools
Issued by the MATFUND Foundation
Already signed up?
New to KöMaL?

Exercises and problems in Informatics
January 2003

Please read The Conditions of the Problem Solving Competition.

I. 40. Every row, column and both main diagonals of the square in the figure contain a prime number with five digits when rows and the diagonals are read from left to right, and columns from top to bottom. Moreover,

  • the sum of the digits of the prime numbers must be the same,

  • the digit in the top left corner is given in advance,

  • any prime number can be re-used in the actual square and

  • a prime number can not have any zero leading digit, that is, for example, 00003 is not a prime number with five digits.


    Your program (I40.pas, ...) should read the sum of the digits of the prime numbers, further the digit to be placed into the top left corner, then display the corresponding square.

    In the example, the sum of the digits=11, while the top left digit=1.

    (10 points)

    I. 41. A square is divided into smaller light or dark squares. We can obtain different figures by rotating the original square or reflecting it around its axes of symmetry. (However, it may happen that some transformations, or combination of transformations produce the same - possibly the original - figure.)

    Write your program (I41.pas, ...) which reads the colouring of the NxN square using the symbols V (=light) and S (=dark), successively representing in each row the colours of the small squares, then displays the square together with all different images under all combinations of transformations.

    The example shows for N=3 the original square=((S,S,V),(V,V,V),(V,S,S)) and all possible images under the transformations.

    (10 points)

    I. 42. The exchange rates between 100 units of some foreign currency and HUF (=Ft) are stored in a table. For example, 100 AUD is worth 13279 HUF.

    Prepare a sheet (I42.xls) which - using a fixed table of foreign currency - computes all the exchange rates in the fourth column if any amount of a single (but arbitrary) currency in the third column has been entered.

    See the examples.

    AUD13279 176,96
    CAD15014 156,51
    CHF16287 144,28
    CZK777 3024,32
    EUR23835 98,59
    HUF100 23499,00
    PLZ6051 388,35
    SEK2618 897,59
    SKK580 4051,55
    AUD13279 2,93
    CAD15014 2,59
    CHF16287 2,39
    EUR23835 1,63
    HUF100 388,50
    PLZ6051 6,42
    SEK2618 14,84
    SKK580 66,98
    USD23499 1,65

    (10 points)

    Send your solutions to the following e-mail address:

    Deadline: 13 February 2003