#!/usr/bin/perl

$averageto = $ARGV[0];
for ($i = 0; $i < $averageto + 1; $i++) {
	$_ = <STDIN>;
	chomp;
	$temp[$i] = $_;
}

while (<STDIN>) {
	chomp;
	$x = 0;
	for ($i = 0; $i < $averageto + 1; $i++) {
		$x += $temp[$i];
	}
	$x = $x + $_;
	$x = $x  / ($averageto + 1);
	print "$x\n";
	for ($i = 0; $i < $averageto; $i++) {
		$temp[$i] = $temp[($i + 1)];
	}
	$temp[($averageto -1)] = $_;
}
