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

27000번 - Skiing 스페셜 저지다국어

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

문제

Bessie and the rest of Farmer John's cows are taking a trip this winter to go skiing. One day Bessie finds herself at the top left corner of an R (1 ≤ R ≤ 100) by C (1 ≤ C ≤ 100) grid of elevations E (-25 ≤ E ≤ 25). In order to join FJ and the other cows at a discow party, she must get down to the bottom right corner as quickly as she can by travelling only north, south, east, and west.

Bessie starts out travelling at a initial speed V (1 ≤ V ≤ 1,000,000). She has discovered a remarkable relationship between her speed and her elevation change. When Bessie moves from a location of height A to an adjacent location of eight B, her speed is multiplied by the number 2^(A-B). The time it takes Bessie to travel from a location to an adjacent location is the reciprocal of her speed when she is at the first location.

Find the both smallest amount of time it will take Bessie to join her cow friends.

입력

  • Line 1: Three space-separated integers: V, R, and C, which respectively represent Bessie's initial velocity and the number of rows and columns in the grid.
  • Lines 2..R+1: C integers representing the elevation E of the corresponding location on the grid.

출력

A single number value, printed to two exactly decimal places: the minimum amount of time that Bessie can take to reach the bottom right corner of the grid.

제한

예제 입력 1

1 3 3
1 5 3
6 3 5
2 4 3

예제 출력 1

29.00

힌트

출처

Olympiad > USA Computing Olympiad > 2005-2006 Season > USACO October 2005 Contest > Gold ?번

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

출처

대학교 대회

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

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