Counting Triangles

You are given a convex polygon of N vertices. Find how many ways three vertices can be chosen such that the triangle formed by those has an area not more than K. Input The first line of input contains T which is the number of tests cases. Each case contains two integers N and K. Each of the next N lines will contain two integers: xi yi denoting i-th vertex of the polygon. The vertices will be given in anti-clockwise order. Output For each test case output one line the number of ways to choose a triangle from the vertices of the convex polygon whose area is not more than K. Sample Input 1 5 30 -5 -5 -2 -10 30 17 -2 4 Sample Output 7