help needed in graph problem

Revision en1, by brucewayne123, 2016-05-31 18:43:44 i was trying this problem but i dont know why i am getting wrong answer on test 7.. my code outputs some negative value(maybe an overflow error but i checked and wasnt able to found one). please someone look through my code and help.. my submission :- PS:- i matched my solution with some accepted one and my logic is same.


  Rev. Lang. By When Δ Comment
en1 English brucewayne123 2016-05-31 18:43:44 455 Initial revision (published)