UVA Problem ID: 459 (Graph Connectivity)