can anybody please see why i am getting wrong answer in the spoj counting triangles II problem link for problem:http://www.spoj.com/problems/TCOUNT2/ my solution in c http://ideone.com/gtdCUY my solution in pascal http://ideone.com/O0kW1o asked 27 Sep '13, 15:08

The correct formula for this problem is : (n(n+2)(2n+1))/8 answered 04 Jul '14, 18:26
