| 记录编号 | 
        348767 | 
        评测结果 | 
        AAAAAAAAAA | 
    
    
        | 题目名称 | 
        2545.输出全靠花 | 
        最终得分 | 
        100 | 
            
    
    
        | 用户昵称 | 
         残星噬月 | 
        是否通过 | 
        通过 | 
    
    
        | 代码语言 | 
        C++ | 
        运行时间 | 
        0.102 s  | 
    
    
        | 提交时间 | 
        2016-11-14 16:12:29 | 
        内存使用 | 
        10.66 MiB  | 
        
    
    
    
    		显示代码纯文本
		
		#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
struct sw
{
	int x;
	int y;
	int z;
	int w;
}s[1001];
int a[41][41][41][41];
int b[21][21][21][21];
int MAX=0;
void gcd(int x1,int y1,int z1,int w1)
{
	for(int i=2;i<=20;i++)
	{
		if(x1%i==0&&y1%i==0&&z1%i==0&&w1%i==0)
		{
			x1=x1/i;
			y1=y1/i;
			z1=z1/i;
			w1=w1/i;
		}
	}
}
int main()
{   freopen("xumingshi.in","r",stdin);
    freopen("xumingshi.out","w",stdout);
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		
		cin>>s[i].x>>s[i].y>>s[i].z>>s[i].w;
		s[i].w+=20;
		s[i].x+=20;
		s[i].y+=20;
		s[i].z+=20;
		a[s[i].x][s[i].y][s[i].z][s[i].w]=1;
	}
	for(int i=0;i<n;i++)
	 for(int j=i+1;j<n;j++)
	 {  //cout<<i<<" "<<j<<endl;
	    int ans=0;
	 	int x1=s[j].x-s[i].x;
	 	int y1=s[j].y-s[i].y;
	 	int z1=s[j].z-s[i].z;
	 	int w1=s[j].w-s[i].w;
		gcd(x1,y1,z1,w1);
		int x2=s[i].x;
		int y2=s[i].y;
		int z2=s[i].z;
		int w2=s[i].w;
		while(x2<41&&y2<41&&z2<41&&w2<41&&x2>=0&&y2>=0&&z2>=0&&w2>=0)
		{   
		   if(a[x2][y2][z2][w2]==1)ans+=1;
		    // cout<<"P"<<endl;
			x2+=x1;
			y2+=y1;
			z2+=z1;
			w2+=w1;
			//puts("B");
		 }
		  x2=s[i].x;
		  y2=s[i].y;
		  z2=s[i].z;
		  w2=s[i].w;
		while(x2<41&&y2<41&&w2<41&&z2<41&&x2>=0&&y2>=0&&z2>=0&&w2>=0)
		{   
		   //cout<<"A"<<endl;
	      if(a[x2][y2][z2][w2]==1)ans+=1;
			x2-=x1;
			y2-=y1;
			z2-=z1;
			w2-=w1;
		
		  } 
		  ans-=1; 
		  MAX=max(ans,MAX);
		  }
		 cout<<MAX<<endl;
		 return 0;  
}
/*
3 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
*/