#pragma GCC optimize("Ofast") #pragma GCC target("avx2") char*mmap(); #define rd_skip() while(*rp++>=48) #define rd(v) int v=0;{int _c;while(_c=*rp++-48,_c>=0)v=v*10+_c;} char wbuf[1<<28]; #define WTHI(v) {int _z=v,_n=0;long _d=0;while(++_n,_d=_d<<8|0x30|_z%10,_z/=10);*(long*)wp=_d;wp+=_n;} #define WTLO(v) {int _z=v,_n=8;long _d=0;while(_d=_d<<8|0x30|_z%10,_z/=10,--_n);*(long*)wp=_d;wp+=8;} #define wt(v) WTHI(v) #define rep(v,e) for(int v=0;v=p*p){ if(a%p==0){ int k=1; while(a/=p,a%p==0){ ++k; } int n0=n*k; for(int j=0;j1){ int n0=n; for(int j=0;jy){ int t=x;x=y;y=t; } int nd=divisors(y-x,d); rep(i,nd){ int a=d[i]+1; int c=(y-x)/(a-1); int b=(x-c)/(a+1); c+=b; res+=b>0&c>0&&a*b+c==x&&a*c+b==y; } } wt(res); *wp++=10; } write(1,wbuf,wp-wbuf); _exit(0); }