output_description: Print an integer representing the minimum number of minutes needed to make N
  pieces of takoyaki.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N X T
attempt: H, W = map(int, input().split())
  Ch, Cw = map(int, input().split())
  Dh, Dw = map(int, input().split())
  S = [list(map(str, list(input()))) for i in range(H)]
  
  ah = Ch
  aw = Cw
  count = 0
  
  while (ah != Dh) or (aw != Dw):
      h = Dh - ah
      w = Dw - aw
      if h > 0:
          if S[ah + 1][aw] == ".":
              ah = ah + 1
      if h < 0:
          if S[ah - 1][aw] == ".":
              ah = ah - 1
      if w > 0:
          if S[ah][aw + 1] == ".":
              aw = aw + 1
      if w < 0:
          if S[ah][aw - 1] == ".":
              aw = aw - 1
  print(count)
  
problem_description: Statement
  
  Takahashi loves takoyaki - a ball-shaped snack.
  
  With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
  taking T minutes regardless of the number of pieces to make.
  
  How long does it take to make N takoyaki?
samples: [{"input": "20 12 6", "output": "12\n    \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n    \n\nIt seems to take a long time to make this kind of takoyaki."}]