#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]; // binary_gcd // https://yukicoder.me/submissions/657337 // by akakimidori inline static long binary_gcd(long a,long b){ if(a == 0 || b == 0){ return a + b; } long x = __builtin_ctzl(a); long y = __builtin_ctzl(b); a = a >> x; b = b >> y; while(a != b){ long x = __builtin_ctzl(a ^ b); if(a < b){ long t=a;a=b;b=t; } a = (a - b) >> x; } return a << (x<=y?x:y); } 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