// general helpers
const debug = (message?: any, ...optionalParams: any[]) => {
  if (process.env.LOCAL_DEBUG === '1') console.log(message, ...optionalParams)
}

// helpers
const parseLines = (
  lines: string[]
): { N: number, v: number[] } => {
  const N = +lines[0]
  const v = lines[1].split(' ').map(line => +line)
  const obj = { N, v }
  debug(obj)
  return obj
}
// solver
export const solve = (lines: string[]): string => {
  const { N, v } = parseLines(lines)
  v.reverse()
  const first = v.shift() || 0
  const result = v.reduce((prev, current) => (prev + current) / 2, first)
  return `${result}`
}

// main
const main = (lines: string[]) => {
  console.log(solve(lines))
}

// exec main function for submit
if (process.env.LOCAL_DEBUG !== '1') {
  const { stdin: input, stdout: output } = process
  input.resume()
  input.setEncoding('utf8')
  const lines: string[] = []
  require('readline')
    .createInterface({ input, output })
    .on('line', (line: string) => lines.push(line))
    .on('close', () => main(lines))
}
