#!/usr/bin/perl

my $a_ring=13, $b_ring=12;
my $a_gear=$a_ring-1, $b_gear=$b_ring-1;

printf("A ring\t%d\tA gear\t%d\n", $a_ring, $a_gear);
printf("B ring\t%d\tB gear\t%d\n", $b_ring, $b_gear);

printf("%.5f\n", 1/((($a_ring/$a_gear)-($b_ring/$b_gear))*($b_gear/$b_ring)));
