Logo
(追記) (追記ここまで)

15035번 - I Work All Day 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB23720518587.264%

문제

Michael is a lumberjack, and a pretty OK one at that. However, automation is making fast (if polite) inroads to his business, and he needs to stay ahead to remain competitive.

To this end, he has invented a machine called the Flannelmaster GTX. This is a fearsome treecutting contraption, powered by logarithms, which swings an axe horizontally from a specified height above the ground. Each impact of its electronic axe cuts the tree cleanly into two parts, the stump rolling away and the remainder of the tree falling down into the same place.

This continues until the remaining height is too small to cut any more, at which point any irregular-sized stump is discarded as waste and the remaining lumber of the same length as the setting is neatly packaged and sold on automatically.

What setting should Michael use for the height in order to minimise loss?

입력

  • One line containing the integer N (2 ≤ N ≤ 10), the number of settings;
  • One line containing N distinct integers Hi (1 ≤ H ≤ 500), the possible settings;
  • One line containing the integer T (1 ≤ T ≤ 3000), the height of the tree.

출력

Output the best setting to use so that tree waste will be minimal. If there are multiple settings that yield equally small waste, you may print any one of them.

제한

예제 입력 1

3
5 6 8
103

예제 출력 1

6

예제 입력 2

4
7 3 5 13
1366

예제 출력 2

7

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > The UK & Ireland Programming Contest > UKIEPC 2017 I번

  • 문제를 만든 사람: Robin Lee
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /