Ivan develop computer game now try create level game but firstly level need draw graph represent structure levelIvan decide exactly ni vertex graph represent level edge bidirectional when construct graph Ivan interested special edge call bridge an edge vertex u v call bridge edge belong path u v vertex belong different connect component delete edge for level Ivan want construct graph half edge bridge he want maximize number edge construct graphSo task Ivan give give q number n1n2nq tell maximum number edge graph ni vertex half edge bridge note graph contain multiple edge selfloop