PDP-21 (2009) - Phase C' - 1 (hydrologis)

View as PDF

Submit solution

Points: 25 (partial)
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type
Allowed languages
C, C++, Java, Pascal, Python
HydroloGIS

The Hydrology Laboratory of the National Technical University of Athens (NTUA) has developed a Geographic Information System (GIS) for monitoring hydrological data in the Greek territory (http://titan.chi.civil.ntua.gr/website/greece/viewer.htm). The hydroinformatics authorities are developing numerous applications for real-time processing of a plethora of hydrological data.

For calculating water reserves, several parameters are utilized, mainly: rainfall in millimeters N and sunshine days (evapotranspiration) M, along with the corresponding coefficients a and b for the watershed under study. Of particular interest is the fact that, using appropriate coefficients, each millimeter of rainfall operates multiplicatively on the reserves accumulated previously, and each sunshine day adds to evaporation. For example, for 15 millimeters of rainfall and 100 sunshine days, the total volume of water collected (in cubic meters) is:

V = V_r + a \cdot (1 \cdot 2 \cdot 3 \cdot ... \cdot 15) / 1\,000\,000 - b \cdot (1 + 2 + 3 + ... + 100)

(V_r: Existing reserves, a: concentration coefficient, b: evaporation coefficient).

Problem:

Develop a program in one of the languages of the IOI that reads the above values and calculates the water reserves of a watershed.

Input Files:

The input files, named hydrologis.in, are text files containing five lines with integer numbers N, M, V_r, a, b. For these numbers, the following holds: (10 < N \le 20), (1 \le M \le 365), (1\,000 \le V_r \le 1\,000\,000), (1 \le a, b \le 1\,000).

Output Files:

The output files, named hydrologis.out, are text files with the following structure. They have one line with exactly one integer: the nearest integer to the cubic meters of water reserves V (0 \le V \le 99\,999\,999).

Example of Input - Output File

STDIN (hydrologis.in)

15
100
1000000
1
10

STDOUT (hydrologis.out)

2257174

Formatting: In the output, each line terminates with a newline character.
Maximum execution time: 2 sec.


Comments

There are no comments at the moment.