#dist_f2.pl

open(FILE,"fsize.momo")||die "can't open1:$!\n";
%hash_momo=();
while(<FILE>){
    chomp;
    @words=split(/\s+/,$_);
    $name=$words[0];
    $num=$words[1];
    $hash_momo{$name}=$num;
}
close(FILE);

open(FILE2,"fsize.combi")||die "can't open2:$!\n";
%hash_combi=();
while(<FILE2>){
    chomp;
    ($name2,$num2)=split(/\s+/,$_,2);
    $hash_combi{$name2}=$num2;
    #print"$hash_combi{$name2}\n";
    ($pre,$post)=split(/_/,$name2,2);
    $post2=$post;
    $post2 =~ s/.bz2//g;          #".bz2"ВЁПЬЛО
    $pre2=$pre;             
    $pre=$pre . '.bz2';

    $xy=$hash_combi{$name2};
    $x=$hash_momo{$pre};
    $y=$hash_momo{$post};
    
    if($x>$y){
	$colmo=($xy-$y)/$x;
    }else{
	$colmo=($xy-$x)/$y;
    }
    print"$pre2 $post2 $colmo\n";
}
close(FILE2);

