31.07.2015 Views

LITHUANIAN OLYMPIADS INFORMATICS

LITHUANIAN OLYMPIADS INFORMATICS

LITHUANIAN OLYMPIADS INFORMATICS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

wards). There are no spaces between letters. There are not more than 25 commands inthe sequence. The remaining n lines contain the ornament itself. Black squares areindicated by capital “O”, the white ones – by dots (.).Task. Write a program to draw the new ornament obtained from the given ornamentby performing the given commands.Example: (corresponds to picture a):Input Output Picture that corresponds to the result5KKKAAADOOOOO.O.....O..O..O.OO..OO.....O.O...OOOOOOOO....OSTAGE III, PART I33JUNIOR DIVISION214. Currencies. In many Western European countries conversion currency ratesbetween euro and national currencies are fixed. Then the ratio between different currenciesof these countries also becomes fixed.Given a table of currency rates of N countries (countries are numerated from 1 toN). The number in the i’th column and j’th row indicates how many currency units ofcountry j costs currency unit of country i . Table is not completed, i. e. there are not allconversion rates are known. Zeroes are written instead of unknown conversion rates.Task. With reference to the data in the table restore as many as possible unknownconversion rates, i.e. as many zeroes as possible must be changed with conversionrates. The result is the initial table of conversion ratios complemented with the newlycalculated rates (if it is impossible to calculate conversion rates between currencies ofsome countries, zeroes should remain).Input. The first line of the input file contains the number of countries N (2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!