# 题目

6
0 1 0
-5 3 0
-5 -2 25
0 1 -3
0 1 -2
-4 -5 29

10

## 题解

1. 两条平行线+一条不平行的
2. 三条平行线

# Code

#include<cstdio>
#include<algorithm>
#define mod 1000000007
using namespace std;
long long n,ans,t,c[300001];
struct node
{
long long x,y,z;
}s[300001];
{
long long res=0,fh=1;char ch=getchar();
while ((ch<'0'||ch>'9')&&ch!='-') ch=getchar();
if (ch=='-') fh=-1,ch=getchar();
while (ch>='0'&&ch<='9') res=(res<<1)+(res<<3)+(ch-'0'),ch=getchar();
return res*fh;
}
bool cmp(node x,node y)
{
double pd1=x.y?(double)-x.x/x.y:1e100;
double pd2=y.y?(double)-y.x/y.y:1e100;
return pd1<pd2;
}
long long C3(long long x) {return (x*(x-1)*(x-2)/6%mod);}
long long C2(long long x) {return (x*(x-1)/2)%mod;}
int main()
{
freopen("trokuti.in","r",stdin);
freopen("trokuti.out","w",stdout);
ans=C3(n);
for (int i=1;i<=n;++i)
sort(s+1,s+n+1,cmp);
int i=1,j=1;
while (i<=n)
{
while (j<=n&&s[i].x*s[j].y==s[i].y*s[j].x) ++j;
c[++t]=j-i;
i=j;
}
for (int i=1;i<=t;++i)
ans=(ans+mod-(C2(c[i])*(n-c[i])%mod)-C3(c[i])+mod)%mod;
printf("%lld\n",ans);
fclose(stdin);
fclose(stdout);
return 0;
}


11-02 24
11-16 306
10-28 10