포럼
문제 ICPC00265

H. Hot Hike

설명

In order to pass time during your vacation, you decided to go on a hike to visit a scenic lake up in the mountains. Hiking to the lake will take you a full day, then you will stay there for a day to rest and enjoy the scenery, and then spend another day hiking home, for a total of three days. However, the accursed weather this summer is ridiculously warm and sunny, and since severe dehydration is not at the top of your priority list you want to schedule the three-day trip during some days where the two hiking days are the least warm. In particular you want to minimize the maximum temperature during the two hiking days.

Given the current forecast of daily maximum temperatures during your vacation, what are the best days for your trip?

제약
입력 형식

The first line of input contains an integer \(n\) (\(3 \le n \le 50\)), the length of your vacation in days. Then follows a line containing \(n\) integers \(t_1, t_2, \ldots, t_n\) (\(-20 \le t_i \le 40\)), where \(t_i\) is the temperature forecast for the \(i\)'th day of your vacation.

출력 형식

Output two integers \(d\) and \(t\), where \(d\) is the best day to start your trip, and \(t\) is the resulting maximum temperature during the two hiking days. If there are many choices of \(d\) that minimize the value of \(t\), then output the smallest such \(d\).

예제 1
입력
5
23 27 31 28 30
출력
2 28
예제 2
입력
4
30 20 20 30
출력
1 30
문제 정보

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

출처 ICPC NCPC 2019

평가 및 의견

H. Hot Hike

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

Log in to rate problems.

개별 의견

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

풀이 제출

H. Hot Hike

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