thomas algorithm solved example