Validator

Objective: Given an undirected graph with $n$ ($2 \le n \le 1000$) vertices and $m$ ($1 \le m \le 1000$) edges, verify its validity. Also check if it is a connected graph and if it is a tree.

Report format:
Report: