final version of rettangoli.c