malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   struct node {     int x, y;   };   vector<node> answer;   int dis[1000005], a[1000005], pre[1000005];   bool prime[1000005];   void getprime() {     for (int i = 2; i < 1000005 - 5; i++) {       if (!prime[i]) {         for (int j = i * 2; j < 1000005 - 5; j += i) {           prime[j] = true;         }       }     }     int maxx = 2;     for (int i = 2; i < 1000005 - 5; i++) {       if (prime[i] == false) maxx = i;       pre[i] = maxx;     }   }   int main() {     getprime();     int n;     scanf( %d , &n);     for (int i = 1; i <= n; i++) {       scanf( %d , &a[i]);       dis[a[i]] = i;     }     int t = 0;     for (int i = 1; i <= n; i++) {       if (a[i] == i) continue;       int j = dis[i];       while (j != i) {         int k = pre[j - i + 1];         k = j - k + 1;         node q;         q.x = k, q.y = j;         answer.push_back(q);         swap(dis[a[j]], dis[a[k]]);         swap(a[j], a[k]);         j = k;       }     }     printf( %d n , answer.size());     for (int i = 0; i < answer.size(); i++) {       printf( %d %d n , answer[i].x, answer[i].y);     }   }
//#pragma comment(linker,  /STACK:102400000,102400000 )   #include<bits/stdc++.h>   using namespace std;   typedef long long ll;   #define int ll   typedef pair<int,int>pii;   #define ff first   #define ss second   #define debug(x) std:: cerr << #x <<   =   << x << std::endl;   const int maxn=2010,inf=0x3f3f3f3f,mod=1000000007;   const ll INF=0x3f3f3f3f3f3f3f3f;   const double eps=1e-9;   //#define DEBUG//#define lowbit(x) ((x) & -(x))//<<setiosflags(ios::fixed)<<setprecision(9)   void read(){}   template<typename T,typename... T2>inline void read(T &x,T2 &... oth) {    x=0; int ch=getchar(),f=0;    while(ch< 0 ||ch> 9 ){if (ch== - ) f=1;ch=getchar();}    while (ch>= 0 &&ch<= 9 ){x=(x<<1)+(x<<3)+(ch^48);ch=getchar();}    if(f)x=-x;    read(oth...);   }   ll a[maxn],dp[maxn][maxn];   ll MAX[maxn][maxn],MIN[maxn][maxn];   int s[maxn][maxn];   signed main(signed argc, char const *argv[])   {    std::ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);    #ifdef DEBUG     freopen( input.in ,  r , stdin);    // freopen( output.out ,  w , stdout);    #endif    int n;    cin>>n;    for(int i=1;i<=n;i++)     cin>>a[i];    sort(a+1,a+n+1);    memset(dp,INF,sizeof(dp));   // memset(MIN,INF,sizeof(MIN));    for(int i=1;i<=n;i++)    {     dp[i][i]=0;   //  s[i][i]=i;   //  MAX[i][i]=MIN[i][i]=a[i];    }    for(int len=2;len<=n;len++)    {     for(int l=1;l<=n-len+1;l++)     {      int r=l+len-1;      dp[l][r]=min(dp[l][r-1],dp[l+1][r])+a[r]-a[l];   //   fprintf(stderr, [%lld,%lld]=%lld n ,l,r,dp[l][r]);   //   for(int k=s[l][r-1];k<s[l+1][r];k++)   //   {   //    MAX[l][r]=max(MAX[l][k],MAX[k+1][r]);   //    MIN[l][r]=min(MIN[l][k],MIN[k+1][r]);   //    ll now=min(MAX[l][k]-MIN[k+1][r],a[r]-a[l]);   //    if(dp[l][r]>dp[l][k]+dp[k+1][r]+now)   //    {   //     dp[l][r]=dp[l][k]+dp[k+1][r]+now;   //     s[l][r]=k;   //    }   //   }     }    }    cout<<dp[1][n]<<endl;    return 0;   }   /*    * 2021-04-16-23.54.07   */
#include <bits/stdc++.h>   using namespace std;   long long ar[200004];   long long prefix[200004];   long long D[200004];   void calc(long n) {     D[n] = 0;     long long mx = -1000000000000000000;     for (long i = n - 1; i >= 1; i--) {       D[i] = max(mx, prefix[i + 1] - D[i + 1]);       mx = max(mx, D[i]);     }     std::cout << D[1] << endl;   }   int main() {     std::ios::sync_with_stdio(false);     ;     long n;     std::cin >> n;     for (long i = 1; i <= n; i++) {       std::cin >> ar[i];     }     prefix[0] = 0;     for (long i = 1; i <= n; i++) {       prefix[i] = ar[i] + prefix[i - 1];     }     calc(n);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void solve() {     int n, i, u;     cin >> n >> u;     long long int a[n + 2];     bool pos = false;     double res = 0;     for (i = 0; i < n + 1; ++i) {       cin >> a[i];     }     int j = 0;     for (int i = 0; i < n - 2; i++) {       j = max(j, i + 2);       while (j + 1 < n && a[j + 1] - a[i] <= u) j++;       if (a[j] - a[i] <= u) {         res = max(res, (double(a[j] - a[i + 1])) / (double(a[j] - a[i])));         pos = true;       }     }     if (pos)       cout << fixed << setprecision(10) << res;     else       cout <<  -1 ;     return;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 99999;   int d[maxn], s[maxn];   int n;   int m;   queue<int> q;   vector<pair<int, int> > p;   bool inq[maxn];   int main() {     cin >> n;     for (int i = 0; i < n; i++) {       scanf( %d %d , &d[i], &s[i]), m += d[i];       if (d[i] == 1) q.push(i);     }     m /= 2;     while (!q.empty()) {       int x = q.front();       q.pop();       if (d[x] <= 0) continue;       int y = s[x];       p.push_back(make_pair(x, y));       s[y] ^= x;       d[y]--;       if (d[y] == 1) q.push(s[x]);     }     printf( %d n , p.size());     for (int i = 0; i < p.size(); i++) printf( %d %d n , p[i].first, p[i].second);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n;   int a[200005];   int b[200005];   long long sum;   int res[200005];   int ge[35];   int main() {     scanf( %d , &n);     for (int i = 1; i <= n; i++) scanf( %d , &a[i]), sum += a[i];     for (int i = 1; i <= n; i++) scanf( %d , &b[i]), sum += b[i];     if (n == 1 && a[1] != b[1]) {       puts( -1 );       return 0;     }     if (sum % (n * 2) != 0) {       puts( -1 );       return 0;     }     sum = sum / n;     sum = sum / 2;     for (int i = 1; i <= n; i++) {       int tmp = a[i] + b[i] - sum;       if (tmp % n || tmp < 0) {         puts( -1 );         return 0;       }       tmp = tmp / n;       res[i] = tmp;     }     for (int i = 1; i <= n; i++) {       for (int j = 0; j < 30; j++) {         if (res[i] & (1 << j)) ge[j]++;       }     }     for (int i = 1; i <= n; i++) {       long long nowa = 0, nowb = 0;       for (int j = 0; j < 30; j++) {         if (res[i] & (1 << j)) {           nowa += ge[j] * (1 << j);           nowb += 1ll * n * (1 << j);         } else {           nowb += ge[j] * (1 << j);         }       }       if (nowa != a[i] || nowb != b[i]) {         puts( -1 );         return 0;       }     }     for (int i = 1; i < n; i++) printf( %d  , res[i]);     printf( %d n , res[n]);     return 0;   }
#include<bits/stdc++.h>   using namespace std;   #define endl   n    #define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);   #define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);   const int mx=1e5+123;   int arr[mx];   long long x,cnt;   int main()   {       optimize();       int t;       cin>>t;       while(t--){           int n;           cin>>n;              int arr[n];           for(int i=0;i<n;i++)cin>>arr[i];           sort(arr,arr+n);           int i=1,x=arr[1]-arr[0];           while(i<n){               if(arr[i]-arr[i-1]<x)               x=arr[i]-arr[i-1];                  if(arr[i]<=x)i++;               else break;           }           cout<<i<<endl;                  }             return 0;   }
#include <bits/stdc++.h>   using namespace std;   int q;   unsigned long long a, b, c;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     cin >> q;     while (q--) {       cin >> a >> b >> c;       unsigned long long sum = a + b + c;       cout << sum / 2 <<   n ;       sum = 0;     }     return 0;   }
#include <bits/stdc++.h>   int a[5000], b[5000], n, m, i, j, k = 0;   int main() {     scanf( %d%d , &n, &m);     for (i = 0; i < n; i++) {       scanf( %d , &a[i]);       b[i] = a[i];     }     for (i = 0; i < n; i++)       if (a[i] == b[i])         for (j = 0; j < n; j++)           if (a[j] != b[i] && a[i] != b[j]) {             int z = b[i];             b[i] = b[j];             b[j] = z;             break;           }     for (i = 0; i < n; i++)       if (a[i] != b[i]) ++k;     printf( %d n , k);     for (i = 0; i < n; i++) printf( %d %d n , a[i], b[i]);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(nullptr);     cout << fixed << setprecision(15);     srand(42u);     unsigned int n;     unsigned int m;     cin >> n >> m;     cout << (min(n, m) & 1 ?  Akshat  :  Malvika ) << endl;     return EXIT_SUCCESS;   }
#include <bits/stdc++.h>   using namespace std;   int adder[1234567], pre[1234567];   int main() {     std::ios::sync_with_stdio(false);     long long n, k;     cin >> n >> k;     int i, l, r;     l = 0;     r = 0;     string s;     cin >> s;     for (i = 1; i < n; i++) {       if (r < i) {         l = i;         r = i;         while (r < n && s[r] == s[r - l]) r++;         pre[i] = r - l;         r--;         continue;       }       if (r - i + 1 > pre[i - l]) {         pre[i] = pre[i - l];       } else {         l = i;         while (r < n && s[r] == s[r - l]) r++;         pre[i] = r - l;         r--;       }     }     long long haha, haha1, endp;     for (i = 1; i < n; i++) {       haha = k * i;       haha1 = (k + 1) * i;       endp = i + pre[i];       if (haha > endp) continue;       haha1 = min(haha1, n);       haha1 = min(haha1, endp);       adder[haha]++;       adder[haha1 + 1]--;     }     if (k == 1) {       adder[n]++;     }     for (i = 1; i <= n; i++) {       adder[i] += adder[i - 1];       if (adder[i])         cout << 1;       else         cout << 0;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   FILE *stm;   const double PI = 22.0 / 7.0;   const long long MXN = 1e5 + 1;   const long long MNN = 1e3 + 1;   const long long MOD = 1e9 + 7;   const long long INF = 1e18;   bool srt(string a, string b) { return a.size() > b.size(); }   int gcd(int a, int b) {     if (b == 0)       return a;     else       gcd(b, a % b);   }   int lcm(int a, int b) { return (b / gcd(a, b)) * a; }   int main() {     string first;     cin >> first;     int n = first.size();     int ctr = 0;     int j = 0;     while (first[j] ==  a  and j < n) {       ctr++;       j++;     }     if (ctr == n) {       first[n - 1] =  z ;     } else if (first[0] !=  a ) {       for (int i = 0; i < n and first[i] !=  a ; i++) first[i] = first[i] - 1;     } else if (first[0] ==  a ) {       int i = 0;       while (first[i] ==  a ) {         i++;       }       for (; i < n and first[i] !=  a ; i++) first[i] = first[i] - 1;     }     cout << first << endl;     return 0;   }
#include <bits/stdc++.h>   const int N = 100010;   const int M = 25;   long long dp[M][N];   int cnt[N], a[N];   long long cost, left, right;   void move(int nleft, int nright) {     while (nleft < left) cost += cnt[a[--left]]++;     while (nright > right) cost += cnt[a[++right]]++;     while (nleft > left) cost -= --cnt[a[left++]];     while (nright < right) cost -= --cnt[a[right--]];   }   void solve(int type, int l, int r, int opl, int opr) {     if (l > r) return;     long long mincost = LLONG_MAX;     int mid = l + r >> 1, sit;     for (int i = opl, sz = std::min(opr, mid - 1); i <= sz; ++i) {       move(i + 1, mid);       long long x = dp[type - 1][i] + cost;       if (x < mincost) {         mincost = x;         sit = i;       }     }     dp[type][mid] = mincost;     solve(type, l, mid - 1, opl, sit);     solve(type, mid + 1, r, sit, opr);   }   int main() {     int n, k;     scanf( %d%d , &n, &k);     for (int i = 1; i <= n; ++i) {       scanf( %d , &a[i]);     }     left = 1, right = 0;     move(1, n);     memset(dp[0], 0x3f, sizeof(dp[0]));     dp[0][0] = 0;     for (int i = 1; i <= k; ++i) {       solve(i, 1, n, 0, n);     }     return printf( %I64d n , dp[k][n]), 0;   }
#include <bits/stdc++.h>   using namespace std;   string s;   string name;   string hostname;   string res;   int is_good(char c) {     if (c -  a  >= 0 && c -  a  < 26) return 1;     if (c -  A  >= 0 && c -  A  < 26) return 1;     if (c -  0  >= 0 && c -  0  < 10) return 1;     if (c ==  _ ) return 1;     return 0;   }   int main() {     cin >> s;     int tk = 0;     int cl1 = 0;     int cl2 = 0;     for (int i = 0; i < s.length(); i++) {       if (s[i] ==  @ ) {         if (tk != 0) {           printf( NO n );           return 0;         }         tk = 1;         cl1++;         continue;       }       if (s[i] ==  / ) {         cl2++;         if (tk != 1) {           printf( NO n );           return 0;         }         tk = 2;         continue;       }       if (tk == 0) name += s[i];       if (tk == 1) hostname += s[i];       if (tk == 2) res += s[i];     }     if (res ==    && cl2 != 0) {       printf( NO n );       return 0;     }     if (name ==    || hostname ==   ) {       printf( NO n );       return 0;     }     if (name.length() > 16 || hostname.length() > 32 || res.length() > 16) {       printf( NO n );       return 0;     }     for (int i = 0; i < name.length(); i++)       if (!is_good(name[i])) {         printf( NO n );         return 0;       }     for (int i = 0; i < res.length(); i++)       if (!is_good(res[i])) {         printf( NO n );         return 0;       }     int tl = 0;     for (int i = 0; i < hostname.length(); i++)       if (hostname[i] ==  . ) {         if (tl > 16 || tl == 0) {           printf( NO n );           return 0;         }         tl = 0;         continue;       } else if (!is_good(hostname[i])) {         printf( NO n );         return 0;       } else         tl++;     if (tl > 16 || tl == 0) {       printf( NO n );       return 0;     }     if (cl1 > 1 || cl2 > 1) {       printf( NO n );       return 0;     }     printf( YES n );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 1005;   int main() {     int i, j;     int n, pare[maxn], mark[maxn];     while (scanf( %d , &n) != EOF) {       memset(pare, 0, sizeof(pare));       memset(mark, 0, sizeof(mark));       for (i = 2; i <= n; i++) {         scanf( %d , &pare[i]);         mark[pare[i]] = 1;       }       for (i = n; i >= 2; i--)         if (mark[i] == 0) {           mark[pare[i]]++;         }       for (i = 1; i <= n; i++) {         if (mark[i] != 0 && mark[i] < 4) break;       }       if (i == (n + 1))         printf( YES n );       else         printf( NO n );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     int k;     cin >> k;     k += 2000;     cout << 2000 <<   n ;     cout << -1 <<    ;     for (int i = 0; i < 1999; i++) {       if (k > 1000000) {         cout << 1000000 <<    ;         k -= 1000000;       } else {         cout << k <<    ;         k = 0;       }     }     cout <<   n ;     return 0;   }
#include <bits/stdc++.h>   #pragma GCC optimize( O3 )   #pragma GCC optimize( Ofast )   using namespace std;   void solve() {     long long n;     cin >> n;     vector<long long> a(n), b(n);     for (long long &i : a) cin >> i;     for (long long &i : b) cin >> i;     sort(a.begin(), a.end());     sort(b.begin(), b.end());     for (long long &i : a) cout << i <<    ;     cout << endl;     for (long long &i : b) cout << i <<    ;     cout << endl;   }   signed main() {     ios_base::sync_with_stdio(0);     cin.tie();     cout.tie();     long long n = 1;     cin >> n;     while (n--) solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int i, j, k, t, cnt = 0, flag, cs = 1;     pair<int, int> A[110];     scanf( %d %d , &j, &k);     for (i = 0; i < j; i++) {       scanf( %d , &A[i].first);       A[i].second = i + 1;     }     sort(A, A + j);     vector<int> v;     int sum = 0;     for (i = 0; i < j; i++) {       sum += A[i].first;       if (sum > k) break;       cnt++;       v.push_back(A[i].second);     }     cout << cnt << endl;     if (cnt == 0) return 0;     for (i = 0; i <= cnt - 2; i++) cout << v[i] <<    ;     cout << v[i] << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int d[1008][1008];   int main() {     int n, x1, x2, y1, y2;     int di[] = {0, 0, 1, -1};     int dj[] = {1, -1, 0, 0};     cin >> n >> x1 >> y1 >> x2 >> y2;     int i, j, k;     d[n - y1][x1] = 1;     queue<int> qi, qj, dist;     qi.push(n - y1);     qj.push(x1);     dist.push(1);     int ii, jj, D;     while (!qi.empty()) {       ii = qi.front();       jj = qj.front();       qi.pop();       qj.pop();       D = dist.front();       dist.pop();       int t1, t2;       for (k = 0; k < 4; k++) {         t1 = ii + di[k];         t2 = jj + dj[k];         if ((t1 == 0 || t1 == n || t2 == 0 || t2 == n) && d[t1][t2] == 0 &&             (t1 >= 0 && t1 <= n && t2 >= 0 && t2 <= n)) {           d[t1][t2] = D + 1;           qi.push(t1);           qj.push(t2);           dist.push(D + 1);         }       }     }     cout << d[n - y2][x2] - 1 << endl;     return 0;   }
#include <bits/stdc++.h>   int main() {     using namespace std;     ios_base::sync_with_stdio(false);     cin.tie(nullptr);     string b, b1, b2, e, e1, e2;     cin >> b1 >> b2 >> e1 >> e2;     swap(b2[0], b2[1]);     swap(e2[0], e2[1]);     b = b1 + b2;     e = e1 + e2;     b.erase(b.find( X ), 1);     e.erase(e.find( X ), 1);     if ((b + b).find(e) != string::npos) {       cout <<  YES ;     } else {       cout <<  NO ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int t, k;   int a, b;   int dp[100005];   int sum[100005];   int main() {     scanf( %d%d , &t, &k);     for (int i = 1; i <= k - 1; i++) {       dp[i] = 1;     }     dp[k] = 2;     for (int i = k + 1; i <= 100000; i++) {       dp[i] = (dp[i - 1] + dp[i - k]) % 1000000007;     }     for (int i = 1; i <= 100000; i++) {       sum[i] = (sum[i - 1] + dp[i]) % 1000000007;     }     for (int i = 0; i < t; i++) {       scanf( %d%d , &a, &b);       printf( %d n , (sum[b] - sum[a - 1] + 1000000007) % 1000000007);     }   }
#include <bits/stdc++.h>   using namespace std;   string s;   map<char, int> u;   int main() {     cin >> s >> s;     for (auto x : s) ++u[x];     if (u.size() == 1) return puts( Yes ), 0;     for (auto& x : u)       if (x.second >= 2) return puts( Yes ), 0;     puts( No );   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(false);     ;     long long int T, N, X;     cin >> T;     while (T--) {       cin >> N >> X;       vector<bool> Pl(100100);       for (long long int i = 0, P; i < N; i++) {         cin >> P;         Pl[P - 1] = true;       }       for (long long int i = 0; i < 100100; i++) {         if (!Pl[i] && X > 0) {           Pl[i] = true;           X--;         }       }       long long int Counter = 0;       for (long long int i = 0; i < 100100; i++) {         if (Pl[i])           Counter++;         else           break;       }       cout << Counter << endl;     }   }
#include <bits/stdc++.h>   using namespace std;   set<pair<int, int> > second;   int arr[(int)(1e5) + 30];   int main() {     int n, m;     int u, v;     cin >> n >> m;     for (int i = 0; i < m; i++) {       cin >> u >> v;       second.insert(make_pair(u, v));       second.insert(make_pair(v, u));     }     for (int i = 0; i < n; i++) arr[i] = i + 1;     int limit = 1000;     while (limit--) {       random_shuffle(arr, arr + n);       arr[n] = arr[0];       for (int i = 0; i < m; i++) {         if (second.find(make_pair(arr[i], arr[i + 1])) != second.end()) goto re;       }       for (int i = 0; i < m; i++) cout << arr[i] <<     << arr[i + 1] << endl;       return 0;     re:;     }     puts( -1 );   }
#include <bits/stdc++.h>   using namespace std;   pair<int, int> v[100005];   int a[100008];   int b[100005];   int main() {     int n;     scanf( %d , &n);     for (int i = 0; i < n; i++) {       scanf( %d , &v[i].first);       v[i].second = i;     }     sort(v, v + n);     int val = 0;     int qt = (n + 2) / 3;     int cnt = 0;     for (int i = 0; i < n; i++) {       if (i < qt) {         int idx = v[i].second;         a[idx] = i;         b[idx] = v[i].first - i;       } else if (i < 2 * qt) {         int idx = v[i].second;         b[idx] = i;         a[idx] = v[i].first - i;       } else {         int idx = v[i].second;         b[idx] = n - 1 - i;         a[idx] = v[i].first - b[idx];       }     }     puts( YES );     for (int i = 0; i < n; i++) {       printf( %d  , a[i]);     }     puts(  );     for (int i = 0; i < n; i++) {       printf( %d  , b[i]);     }     puts(  );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int h, m, m2;     char c;     scanf( %d %c %d , &h, &c, &m);     scanf( %d , &m2);     m2 += m;     int h2 = (int)(m2 / 60);     h2 += h;     h2 %= 24;     m2 = m2 % 60;     if (h2 >= 0 && h2 <= 9) printf( 0 );     printf( %d: , h2);     if (m2 >= 0 && m2 <= 9) printf( 0 );     printf( %d n , m2);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long INF = 1e18;   const int32_t M = 1e9 + 7;   const long long N = 1e6 + 5;   void no() { cout <<  0 0 0  << endl; }   void cpc() {     ios::sync_with_stdio(false);     cin.tie(nullptr);     cout.tie(NULL);   }   void solve() {     long long n;     cin >> n;     vector<long long> v(n);     for (long long i = 0; i < n; i++) cin >> v[i];     long long j = n / 2 - 1;     while (j >= 4 && v[j] <= v[j + 1]) j--;     if (j < 4) {       no();       return;     }     deque<long long> va;     va.push_front(j);     j--;     while (j >= 0) {       if (v[j] > v[j + 1]) va.push_front(j);       j--;     }     va.push_front(-1);     if (va.size() < 4) {       no();       return;     }     long long a, b, c, d;     a = va[0];     b = va[1];     c = -1;     d = va[va.size() - 1];     long long dis = b - a;     for (long long i = 0; i < n; i++) {       if ((va[i] - b) > dis) {         c = va[i];         break;       }     }     if (c == -1 || (d - c) <= dis) {       no();       return;     }     cout << b - a <<     << c - b <<     << d - c <<     << endl;   }   int32_t main() {     cpc();     long long t;     cin >> t;     while (t--) solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int M = 1e5 + 10, N = 2e4 + 10;   const int n = 1e5;   long long ans, s[M];   int gcd(int x, int y) {     int i = 0, j = 0;     if (x == 0) return y;     if (y == 0) return x;     for (; 0 == (x & 1); i++) x >>= 1;     for (; 0 == (y & 1); j++) y >>= 1;     if (i > j) i = j;     while (1) {       if (x < y) x ^= y, y ^= x, x ^= y;       if (0 == (x -= y)) return y << i;       while (0 == (x & 1)) x >>= 1;     }   }   int T, A, B, C;   int prime[N], cc[M], cnt;   bool vis[M];   void init() {     s[1] = 1;     for (int i = 2; i <= n; i++) {       if (!vis[i]) {         prime[++cnt] = i;         s[i] = 2;         cc[i] = 1;       }       for (int j = 1, v; j <= cnt && i * prime[j] <= n; j++) {         v = i * prime[j];         vis[v] = 1;         if (!(i % prime[j])) {           s[v] = s[i] / (cc[i] + 1) * (cc[i] + 2);           cc[v] = cc[i] + 1;           break;         }         s[v] = s[i] * s[prime[j]];         cc[v] = 1;       }     }   }   long long all(int a, int b, int c) { return s[a] * s[b] * s[c]; }   long long S(long long a) { return (a * (a - 1ll)) / 2ll; }   long long S2(long long a) { return (a * (a - 1ll) * (a - 2ll)) / 6ll * 4ll; }   long long calc1(int ab, int c) { return S(s[ab]) * s[c]; }   long long calc2(int a, int bc) { return s[a] * S(s[bc]); }   long long calc3(int abc) { return S(s[abc]) * 2ll + S2(s[abc]); }   long long calc4(int ab, int abc) { return (s[ab] - s[abc]) * S(s[abc]); }   long long calc5(int ab, int bc, int ac, int abc) {     return (s[ab] - s[abc]) * (s[bc] - s[abc]) * (s[ac] - s[abc]);   }   int ab, bc, ac, abc;   long long solve() {     return all(A, B, C) - calc1(ab, C) - calc2(A, bc) - calc2(B, ac) +            calc4(ab, abc) + calc4(bc, abc) + calc4(ac, abc) -            calc5(ab, bc, ac, abc) + calc3(abc);   }   int main() {     init();     for (scanf( %d , &T); T--;) {       scanf( %d%d%d , &A, &B, &C);       ab = gcd(A, B), bc = gcd(B, C), ac = gcd(A, C);       abc = gcd(A, bc);       printf( %I64d n , solve());     }     return 0;   }