e-olymp
Competitions

2013 IX Международная Жаутыковская Олимпиада Алматы, Казахстан, 16 января

Schools

Recently Akim of some state decided to open exactly m music and s sports schools to support education in the state. There are n dierent cities in the state. For each of the cities both the number of students ready to study in music school and the number of students ready to study in sports school is known. Being a big fan of eciency, Akim doesn't want to open more than one school in any city (it's possible that he won't open any school in some cities).

You, as Akim's consultant, are given a task of developing a plan that would maximize the number of students that would study in the newly opened schools in the state.

Input

First line contains three integer numbers: n (1n300000), m, s (0 ≤ min(m, s) и m + sn) - the number of cities in the state, the number of music and sports schools that Akim wishes to open respectively.

Each of the following n lines contains two integer numbers: Ai (1 ≤ Ai105) and Bi (1 ≤ Bi105) the number of students in the i-th city that wish to study in music and sports school respectively.

Output

Output one integer number  the number of students that will study in the newly opened schools in an optimal plan.

Time limit 1 second
Memory limit 64 MiB
Input example #1
3 1 1
5 2
4 1
6 4
Output example #1
9
Input example #2
7 2 3
9 8
10 6
3 5
1 7
5 7
6 3
5 4
Output example #2
38
Source 2013 IX Zhautykov Olympiad Almaty, Kazakhstan, January 16