func_code_string: #include <bits/stdc++.h>   using namespace std;   long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }   const int MAXN = 16;   int n;   int mod[MAXN], rem[MAXN];   int egcd(int a, int b, int &x, int &y) {     if (b == 0) {       x = 1, y = 0;       return a;     }     int g = egcd(b, a % b, x, y);     swap(x, y);     y -= x * (a / b);     return g;   }   int mymod(int x, int mod) {     x %= mod;     if (x < 0) x += mod;     return x;   }   bool combine(int &n1, int &a1, int n2, int a2) {     int m1, m2, g = egcd(n1, n2, m1, m2);     if (a1 % g != a2 % g) return false;     int n3 = n1 / g * n2, a3 = mymod(a1 + m1 * (n1 / g) * (a2 - a1), n3);     n1 = n3, a1 = a3;     return true;   }   void run() {     scanf( %d , &n);     for (int i = (0); i < (n); ++i) scanf( %d , &mod[i]);     for (int i = (0); i < (n); ++i) scanf( %d , &rem[i]);     long long den = 20922789888000LL, num = 0;     for (int i = (0); i < (1 << n); ++i) {       int cmod = 1, crem = 0, cnt = 0;       bool ok = true;       for (int j = (0); j < (n); ++j)         if (i & (1 << j)) {           ++cnt;           if (!combine(cmod, crem, mod[j], rem[j])) ok = false;         }       if (!ok) continue;       if (cnt % 2 == 0)         num += den / cmod;       else         num -= den / cmod;     }     printf( %.9lf n , 1.0 * (den - num) / den);   }   int main() {     run();     return 0;   }   