long int leaf(long int *lst, int len)
{
    long int d;
    d = lst[0] - lst[ len-1 ];
    return d;
}