Language: C++

#import<cstdio>
#import<map>
#define I(M,A)for(i=1;i<=M;i++)scanf("%d",A+i),A[i]+=A[i-1];
n[1501],m[1501],o,a,b,i,j;main(){for(scanf("%d%d",&a,&b),a;printf("%d\n",o)){std::map<int,int>z;*n=*m=o=0;I(a,n)I(b,m)for(i=0;i<=a;i++)for(j=0;j<=b;)z[n[i]+m[j++]]++;for(typeof(z.begin())p=z.begin();p!=z.end();)o+=p->second*(p++->second-1)/2;}}

Compiler output:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import<cstdio>
      |  ^~~~~~
a.cc:2:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    2 | #import<map>
      |  ^~~~~~
a.cc:4:1: error: 'n' does not name a type
    4 | n[1501],m[1501],o,a,b,i,j;main(){for(scanf("%d%d",&a,&b),a;printf("%d\n",o)){std::map<int,int>z;*n=*m=o=0;I(a,n)I(b,m)for(i=0;i<=a;i++)for(j=0;j<=b;)z[n[i]+m[j++]]++;for(typeof(z.begin())p=z.begin();p!=z.end();)o+=p->second*(p++->second-1)/2;}}
      | ^
a.cc:4:27: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | n[1501],m[1501],o,a,b,i,j;main(){for(scanf("%d%d",&a,&b),a;printf("%d\n",o)){std::map<int,int>z;*n=*m=o=0;I(a,n)I(b,m)for(i=0;i<=a;i++)for(j=0;j<=b;)z[n[i]+m[j++]]++;for(typeof(z.begin())p=z.begin();p!=z.end();)o+=p->second*(p++->second-1)/2;}}
      |                           ^~~~
a.cc: In function 'int main()':
a.cc:4:52: error: 'a' was not declared in this scope
    4 | n[1501],m[1501],o,a,b,i,j;main(){for(scanf("%d%d",&a,&b),a;printf("%d\n",o)){std::map<int,int>z;*n=*m=o=0;I(a,n)I(b,m)for(i=0;i<=a;i++)for(j=0;j<=b;)z[n[i]+m[j++]]++;for(typeof(z.begin())p=z.begin();p!=z.end();)o+=p->second*(p++->second-1)/2;}}
      |                                                    ^
a.cc:4:55: error: 'b' was not declared in this scope
    4 | n[1501],m[1501],o,a,b,i,j;main(){for(scanf("%d%d",&a,&b),a;printf("%d\n",o)){std::map<int,int>z;*n=*m=o=0;I(a,n)I(b,m)for(i=0;i<=a;i++)for(j=0;j<=b;)z[n[i]+m[j++]]++;for(typeof(z.begin())p=z.begin();p!=z.end();)o+=p->second*(p++->second-1)/2;}}
      |                                                       ^
a.cc:4:74: error: 'o' was not declared in this scope
    4 | n[1501],m[1501],o,a,b,i,j;main(){for(scanf("%d%d",&a,&b),a;printf("%d\n",o)){std::map<int,int>z;*n=*m=o=0;I(a,n)I(b,m)for(i=0;i<=a;i++)for(j=0;j<=b;)z[n[i]+m[j++]]++;for(typeof(z.begin())p=z.begin();p!=z.end();)o+=p->second*(p++->second-1)/2;}}
      |                                                                          ^
a.cc:4:76: error: expected ';' before ')' token
    4 | n[1501],m[1501],o,a,b,i,j;main(){for(scanf("%d%d",&a,&b),a;printf("%d\n",o)){std::map<int,int>z;*n=*m=o=0;I(a,n)I(b,m)for(i=0;i<=a;i++)for(j=0;j<=b;)z[n[i]+m[j++]]++;for(typeof(z.begin())p=z.begin();p!=z.end();)o+=p->second*(p++->second-1)/2;}}
      |                                                                            ^
      |                                                                            ;
a.cc:4:98: error: 'n' was not declared in this scope
    4 | n[1501],m[1501],o,a,b,i,j;main(){for(scanf("%d%d",&a,&b),a;printf("%d\n",o)){std::map<int,int>z;*n=*m=o=0;I(a,n)I(b,m)for(i=0;i<=a;i++)for(j=0;j<=b;)z[n[i]+m[j++]]++;for(typeof(z.begin())p=z.begin();p!=z.end();)o+=p->second*(p++->second-1)/2;}}
      |                                                                                                  ^
a.cc:4:101: error: 'm' was not declared in this scope
    4 | n[1501],m[1501],o,a,b,i,j;main(){for(scanf("%d%d",&a,&b),a;printf("%d\n",o)){std::map<int,int>z;*n=*m=o=0;I(a,n)I(b,m)for(i=0;i<=a;i++)for(j=0;j<=b;)z[n[i]+m[j++]]++;for(typeof(z.begin())p=z.begin();p!=z.end();)o+=p->second*(p++->second-1)/2;}}
      |                                                                                                     ^
a.cc:3:19: error: 'i' was not declared in this scope
    3 | #define I(M,A)for(i=1;i<=M;i++)scanf("%d",A+i),A[i]+=A[i-1];
      |                   ^
a.cc:4:107: note: in expansion of macro 'I'
    4 | n[1501],m[1501],o,a,b,i,j;main(){for(scanf("%d%d",&a,&b),a;printf("%d\n",o)){std::map<int,int>z;*n=*m=o=0;I(a,n)I(b,m)for(i=0;i<=a;i++)for(j=0;j<=b;)z[n[i]+m[j++]]++;for(typeof(z.begin())p=z.begin();p!=z.end();)o+=p->second*(p++->second-1)/2;}}
      |                                                                                                           ^
a.cc:3:19: error: 'i' was not declared in this scope
    3 | #define I(M,A)for(i=1;i<=M;i++)scanf("%d",A+i),A[i]+=A[i-1];
      |                   ^
a.cc:4:113: note: in expansion of macro 'I'
    4 | n[1501],m[1501],o,a,b,i,j;main(){for(scanf("%d%d",&a,&b),a;printf("%d\n",o)){std::map<int,int>z;*n=*m=o=0;I(a,n)I(b,m)for(i=0;i<=a;i++)for(j=0;j<=b;)z[n[i]+m[j++]]++;for(typeof(z.begin())p=z.begin();p!=z.end();)o+=p->second*(p++->second-1)/2;}}
      |                                                                                                                 ^
a.cc:4:123: error: 'i' was not declared in this scope
    4 | n[1501],m[1501],o,a,b,i,j;main(){for(scanf("%d%d",&a,&b),a;printf("%d\n",o)){std::map<int,int>z;*n=*m=o=0;I(a,n)I(b,m)for(i=0;i<=a;i++)for(j=0;j<=b;)z[n[i]+m[j++]]++;for(typeof(z.begin())p=z.begin();p!=z.end();)o+=p->second*(p++->second-1)/2;}}
      |                                                                                                                           ^
a.cc:4:140: error: 'j' was not declared in this scope
    4 | n[1501],m[1501],o,a,b,i,j;main(){for(scanf("%d%d",&a,&b),a;printf("%d\n",o)){std::map<int,int>z;*n=*m=o=0;I(a,n)I(b,m)for(i=0;i<=a;i++)for(j=0;j<=b;)z[n[i]+m[j++]]++;for(typeof(z.begin())p=z.begin();p!=z.end();)o+=p->second*(p++->second-1)/2;}}
      |                                                                                                                                            ^