31.07.2015 Views

LITHUANIAN OLYMPIADS INFORMATICS

LITHUANIAN OLYMPIADS INFORMATICS

LITHUANIAN OLYMPIADS INFORMATICS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

30Task. Write a program to multiply two numbers in this way. It is known that theproduct will not exceed maxlongint.All different intermediate values and the calculated product of the given numbersmust be written. Input data corresponding the example above would be 325 6874,and the result would contain four numbers:6874 34370 474306 2234050.STAGE IIJUNIOR DIVISION208. Who Had Stolen the Wallet (theoretical problem). The wallet had disappearedin one office. All five persons who were in that room were interrogated and thefollowing evidences were obtained:EMILIA: 1. I did not steal it;4. I have never stolen anything in my life;5. Tadas stole it;JUDITH: 1. I did not steal it;4. My father is rich enough and I have my own wallet;5. Rita knows who did it;DARIUS: 1. I do not know anything about stealing;4. I met Rita one year ago;TADAS:5. Tadas did it;1. I am innocent of this crime;4. Rita did it;5. Emilia is lying when she says I did it;RITA: 1. I did not steal the wallet ;4. Judith is guilty;5. Darius can vouch for me, because we are friends from childhood;Further interrogation let to determine that all five persons gave two true and onefalse evidence.Task. Determine from the given data of interrogation, who had stolen the wallet.Explain your solution.209. Interesting Sequence. Sequence is generated in the following way. The firstmember is any odd natural number greater than one. Each further member is equal to:p div 2, if p is even;3p+1, if p is odd;where p is the previous member of the sequence. The sequence is finished when one(1) is obtained. For example, the first member of the sequence is equal to 7. Then thefollowing sequence is obtained:7 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1Supposedly, this sequence is always finite. However, this assumption has not beenproved yet.

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

Saved successfully!

Ooh no, something went wrong!