Czech ACM Student Chapter
Czech Technical University in Prague
Charles University in Prague
Technical University of Ostrava
Slovak University of Technology
Masaryk University
acm
cz
acm
cz
CTU Open Contest 2007
Advanced Creative Marketing
Dear Contestants!
Welcome to the Czech Technical University Open Contest 2007. Every year since 1995, our
university invites best programmers to solve a set of real-life problems.
Today, your task will be to create computer software for a new advertising agency called Ad-
vanced Creative Marketing (ACM). Unlike in previous years, you may use C, C++, Pascal,
or Java programming languages. The choice is yours but you will be fully responsible for the
speed of your solution. ACM needs e.cient and fast programs, because in marketing, everything
changes very dynamically.
All of your programs will read one single file from the standard input. The results will be written
to the standard output. You are not allowed to use any other files. Input and output formats
are described in problem statements and you program must comply with it. If not specified
otherwise, all input numbers and results will fit into a signed 32-bit integer type.
As mentioned before, we need the correct answer produced in some limited time. Nothing else
matters. You may choose any algorithm, any programming style.
Good luck with your mission!
Your organizing team
This problem set consists of ten sheets of paper (including this one) and contains nine problems.
Please make sure that you have the complete set.