#pragma GCC optimize("Ofast") #pragma GCC target("avx2") char*mmap(); #define rd_skip() while(*rp++>=48) #define rd_long(v) long v=0;{int _c;while(_c=*rp++-48,_c>=0)v=v*10+_c;} char wbuf[1<<28]; int is_coprime(long a,long b){ long c; while(c=a-b){ c>>=__builtin_ctzl(c); if(c<0){ b=-c; }else{ a=c; } } return a==1; } main(){ char*rp=mmap(0l,1l<<28,1,2,0,0ll); char*wp=wbuf; rd_skip(); do{ rd_long(n); rd_long(a); rd_long(b); if(a+b