output_description: Print the maximum number of tasty cookies that Takahashi can eat.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      A B C
attempt: L,N=(int(i) for i in input().split())
  X = []
  for i in range(0,N):
      a = int(input())
      X.append(a)
  import math
  if X[math.ceil(N/2)]<L/2:
    result=L-X[N-1]
    for i in range (0,math.ceil(N/2)):
      for j in range (N-1,math.ceil(N/2)-1,-1):
        result+=abs(X[j]-X[i])
  else:
    result=X[0]
     for i in range (0,math.ceil(N/2)):
      for j in range (N-1,math.ceil(N/2)-1,-1):
        result+=abs(X[i]-X[j])
  print(result)
problem_description: Statement
  
  Takahashi has A untasty cookies containing antidotes, B tasty cookies
  containing antidotes and C tasty cookies containing poison.
  
  Eating a cookie containing poison results in a stomachache, and eating a
  cookie containing poison while having a stomachache results in a death. As he
  wants to live, he cannot eat one in such a situation. Eating a cookie
  containing antidotes while having a stomachache cures it, and there is no
  other way to cure stomachaches.
  
  Find the maximum number of tasty cookies that Takahashi can eat.
samples: [{"input": "3 1 4", "output": "5\n    \n\nWe can eat all tasty cookies, in the following order:\n\n  * A tasty cookie containing poison\n  * An untasty cookie containing antidotes\n  * A tasty cookie containing poison\n  * A tasty cookie containing antidotes\n  * A tasty cookie containing poison\n  * An untasty cookie containing antidotes\n  * A tasty cookie containing poison\n\n* * *"}, {"input": "5 2 9", "output": "10\n    \n\n* * *"}, {"input": "8 8 1", "output": "9"}]