## Mock CCC '20 Contest 1 J2 - A Simplex Problem

View as PDF

Points: 3 (partial)
Time limit: 1.0s
Memory limit: 1G

Problem type

koosaga has been training hard for programming contests! One day, he decides to study linear programming, which invariably gets him to learn about the simplex algorithm.

Unrelated to the simplex algorithm, koosaga has discovered that there are two things which spark joy in his life - cacti and matroids. If koosaga has cacti and matroids, then his joy is .

koosaga is a busy person though, so cannot be too large. Fortunately, koosaga is a resourceful individual and will be able to obtain arbitrarily many cacti and matroids subject to this constraint.

koosaga wishes to know the maximum joy that can be sparked.

#### Constraints

In tests worth 5 marks, .

In tests worth another 5 marks, and are both equal to .

#### Input Specification

The first line contains a single positive integer, , the amount of joy a single cactus sparks.

The second line contains a single positive integer, , the amount of joy a single matroid sparks.

The third line contains a single positive integer, . The total number of cacti and matroids that koosaga can own may not exceed .

#### Output Specification

Output, on a single line, the maximum amount of joy that can be sparked.

#### Sample Input 1

10
10
1

#### Sample Output 1

10

#### Sample Input 2

1
1
10

#### Sample Output 2

10