#P6501. [COCI 2010/2011 #3] EKIPA

[COCI 2010/2011 #3] EKIPA

Description

A team of nn people is going to take part in mm types of contests. For each type of contest, each person has a level of knowledge accumulation for that contest (given as a decimal with one digit after the point). As the coach, you need to send kk contestants to compete.

It is known that one person can take part in at most one type of contest. Multiple people may take part in the same type of contest, and some people may also not compete. Please arrange kk contestants to take part in contests so that the sum of the knowledge accumulation levels of these kk contestants is maximized.

Input Format

The first line contains three integers n,m,kn,m,k, representing the total number of people, the number of contest types, and the number of contestants actually sent.

The next mm lines describe the mm types of contests. Each line contains nn pairs (i,s)(i,s), meaning that contestant with index ii has knowledge accumulation level ss for this contest type. These nn pairs are given in decreasing order of ss, and each contestant appears exactly once.

Output Format

Output one real number in a single line, representing the maximum total sum of knowledge accumulation levels. Keep one digit after the decimal point.

3 2 2
2 3.0 1 0.2 3 0.1
3 1.0 2 0.5 1 0.2
4.0
4 4 3
4 5.0 2 4.0 3 2.0 1 1.0
2 2.0 3 1.0 1 0.5 4 0.3
4 6.0 3 5.0 2 2.0 1 0.0
1 4.0 2 3.0 4 0.6 3 0.3
15.0

Hint

Explanation for Sample 1

For this sample, we send contestant 22 to the first contest type and contestant 33 to the second contest type. This makes the maximum total 3.0+1.0=4.03.0+1.0=4.0.

Constraints

For 100%100\% of the testdata, it is guaranteed that 1m1001\le m\le 100, 1kn1001\le k\le n\le 100.

Note

This problem is translated from COCI2010-2011 CONTEST #3 T3 EKIPA

Translated by ChatGPT 5