#! /usr/bin/perl -w
# avesubF 
#  list directory and average subdomain size and number
open(R, "system.scf") || die "can't open system.scf file";
$c = <R>;  #discard first line name
chop($dir = `pwd`);
$c = 0;
$ave2 = 0;
while ($line = <R>) {
  @sub = split(" ",$line);
  $ave2 += $sub[1] - $sub[0];
  $c++
}
$ave2 /= $c;
close(R);
printf "%s: %d subdomains size %.2f\n", $dir,$c,$ave2;
