simplified solution to UVa 00574 - no backtracking is needed, just iterate the 'used items' mask