Add solution for UVA problem 540 Team Queue