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

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