포럼
문제 ICPC00250

K. Kayaking Trip

설명

You are leading a kayaking trip with a mixed group of participants in the Stockholm archipelago, but as you are about to begin your final stretch back to the mainland you notice a storm on the horizon. You had better paddle as fast as you can to make sure you do not get trapped on one of the islands. Of course, you cannot leave anyone behind, so your speed will be determined by the slowest kayak. Time to start thinking; How should you distribute the participants among the kayaks to maximize your chance of reaching the mainland safely?

The kayaks are of different types and have different amounts of packing, so some are more easily paddled than others. This is captured by a speed factor \(c\) that you have already figured out for each kayak. The final speed \(v\) of a kayak, however, is also determined by the strengths \(s_1\) and \(s_2\) of the two people in the kayak, by the relation \(v=c(s_1+s_2)\). In your group you have some beginners with a kayaking strength of \(s_b\), a number of normal participants with strength \(s_n\) and some quite experienced strong kayakers with strength \(s_e\).

제약
입력 형식

The first line of input contains three non-negative integers \(b\), \(n\), and \(e\), denoting the number of beginners, normal participants, and experienced kayakers, respectively. The total number of participants, \(b+n+e\), will be even, at least \(2\), and no more than \(100\,000\). This is followed by a line with three integers \(s_b\), \(s_n\), and \(s_e\), giving the strengths of the corresponding participants (\(1 \leq s_b < s_n < s_e \leq 1\,000\)). The third and final line contains \(m = \frac{b+n+e}{2}\) integers \(c_1, \ldots, c_m\) (\(1 \leq c_i \leq 100\,000\) for each \(i\)), each giving the speed factor of one kayak.

출력 형식

Output a single integer, the maximum speed that the slowest kayak can get by distributing the participants two in each kayak.

예제 1
입력
3 1 0
40 60 90
18 20
출력
1600
예제 2
입력
7 0 7
5 10 500
1 1 1 1 1 1 1
출력
505
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC NCPC 2017

평가 및 의견

K. Kayaking Trip

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 1 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

K. Kayaking Trip

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8