#!/usr/athena/bin/perl

$n = shift;

while(<>){
	push(@r, $_);
	if($#r >= ($n-1)){
		print &avg(@r), "\n";
		shift(@r);
	}
}

sub avg {
    @x = @_;
    $ct=0;
    $tot=0;
    for $x (@x){
        $tot += $x;
        $ct++;
    }
    ($tot/$ct);
}
