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

7642번 - Four Gate Push 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB75433764.912%

문제

You are working hard on your Protoss builds in StarCraft II, especially the 4 Gate Push. You’ve come upon a tough problem, however, which is how to determine the distribution of zealots, stalkers, and sentries to maximize your army strength. Recall (although you should already know!) that zealots cost 100 minerals and no gas, stalkers cost 125 minerals and 50 gas, and sentries cost 50 minerals and 100 gas. Given your current economy and how much each unit increases your army strength, determine the maximum army strength you can obtain.

입력

The input consists of multiple test cases, one on each line. Each test case has 5 integers M (0 ≤ M ≤ 50,000), the amount of minerals you have, G (0 ≤ G ≤ 50,000), the amount of gas you have, Z (0 ≤ Z ≤ 1,000), the strength of a zealot in your army, S (0 ≤ S ≤ 1,000), the strength of a stalker in your army, and E (0 ≤ E ≤ 1,000), the strength of a sentry in your army. Input is followed by a single line with M = G = Z = S = E = 0, which should not be processed.

출력

For each case, output a single line containing the maximum army strength you can obtain.

제한

예제 입력 1

500 400 10 20 15
0 0 0 0 0

예제 출력 1

95

힌트

출처

University > Stanford Local ACM Programming Contest > SLPC 2010 Round One F번

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

출처

대학교 대회

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

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