#!/mit/perl5/bin/perl -w

use strict;

my $in=$ARGV[0];
open(IN, $in) || die "Can't open '$in' for reading!\n";
my $base_time=0;
my $last_block=0;
my @summary;
my $delta;
while(<IN>) {
    chomp;
    next if !/Reonna gains Shield Block/;
    my ($date, $time, $else)=split(/\s+/, $_, 3);
    my ($hour, $minute, $second)=split(/:/, $time);
    if ($base_time==0) {
	$base_time=$hour*3600 + $minute*60 + $second;
	next;
    } else {
	$time=$hour*3600 + $minute*60 + $second - $base_time;
	$delta=$time-$last_block;
#	printf ("%.1f\n", $delta);
	$last_block=$time;
    }
    if ($delta<31) {
	$summary[int($delta)]++;
#    } else {
#	print "skipping: $delta\n";
    }
}
for (my $i=5;$i<=30;$i++) {
    next if !defined($summary[$i]);
    print "$i,$summary[$i]\n";
}
close(IN);
