Czech ACM Student Chapter
Czech Technical University in Prague
Charles University in Prague
Technical University of Ostrava
Slovak University of Technology
Pavol Jozef Saf´rik University in Koˇice
University of Zilina
Matej Bel University in Bansk´ Bystrica
University of West Bohemia
CTU Open Contest 2014
>>> Celebrating the Twentieth Anniversary <<<
Twenty years! Can you imagine the world in 1994? We mean, the world of computers ? Most
people did not know about the Internet yet (for a comparison, Seznam.cz was started in the end
of 1995, which means our contest is older). A group of young enthusiastic students at the Czech
Technical University discovered the ACM International Programming Contest and persuaded
one of the teachers to register their team. And she really did...
The CTU team participated in the 1994 South-Western Europe Regional Contest in Zurich and
they liked it so much they decided to organize a similar contest at the Czech Technical University
on May 13, 1995. They could not know they just started a long tradition of the CTU Open
Contest. Today, October 18, 2014, you have a privilege to participate in the 20th year of this
competition. We hope you are going to enjoy it at least as much as the "founding fathers" did
back in 1994/5. And, by the way, you may meet some of them at the Closing Ceremony.
In 1995, the programs had to be written in Pascal or C. Today, you can use C, C++, or Java
programming languages. The choice is yours but you are fully responsible for the correctness
and efficiency of your solutions. We need the correct answer produced in some appropriate time.
Nothing else matters. You may choose any algorithm and any programming style.
All programs will read text from the standard input only. The results must be written to the
standard output. You are not allowed to use any other files, communicate over network, or
create processes. Input and output formats are described in problem statements and must be
strictly followed. Do not print anything more than required. Each text line (including the last
one) should be terminated by a newline character ("\n"), which is not considered to be a part
of that line. If not specified otherwise, all input and output numbers will fit into a signed 32-bit
Good luck in the 20th Czech Technical University Open Contest!
This problem set consists of eleven sheets of paper (including this one) containing ten problems.
Please make sure that you have the complete set.