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

28173번 - Another Goose Goose Duck Problem 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB2541179448.454%

문제

Teacher Rice likes playing the famous game 'Goose Goose Duck'. In the game, Teacher Rice plays a duck and his goal is to kill the geese. Every time he kills a goose, he should wait $a$ seconds for his killing skill to cool down. Since Teacher Rice's role is the Serial Killer, the time Teacher Rice waits depends on which type of goose he kills. Because Teacher Rice is a skilled killer, he can make the waiting time $a$ to be an arbitrary integer in $[\ell,r]$.

Teacher Rice meets a goose every $b$ seconds. Once Teacher Rice meets a goose, he can choose to kill the goose if his killing skill is ready, otherwise the goose runs away immediately and he can not kill this goose.

Teacher Rice wants to know the minimum time he needs to kill $k$ geese.

입력

There are four integers in one line: $\ell,ドル $r,ドル $b,ドル $k$ (1ドル\leq \ell\leq r\leq 10^9,ドル 1ドル\leq b,k\leq 10^9$).

출력

Output one integer denotes the time Teacher Rice needs to kill $k$ geese.

제한

예제 입력 1

6 6 3 3

예제 출력 1

18

예제 입력 2

2 3 5 4

예제 출력 2

20

힌트

출처

ICPC > Regionals > Asia East Continent > Hong Kong > 2023 ICPC Hong Kong Regional H번

Camp > Petrozavodsk Programming Camp > Winter 2023 > Day 3: 2023 ICPC Asia Hong Kong Regional H번

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

출처

대학교 대회

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

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