ans :: [[Int]] -> [Int]
ans ([0]:_) = []
ans (k:l:xs) =
  let a = if (length l) == 1
          then l!!0
          else (sum l) `div` 2
  in
    a:ans xs

main = do
  c <- getContents
  let i = map (map read) $ map words $ lines c :: [[Int]]
      o = ans i
  mapM_ print o
                                                  