Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- /// Typedef
- typedef long long ll;
- #define sc1(a) scanf("%lld",&a)
- #define sc2(a,b) scanf("%lld %lld",&a,&b)
- #define pf1(a) printf("%lld\n", a)
- #define pf2(a,b) printf("%lld %lld\n",a,b)
- #define mx 10000007
- #define mod 1000000007
- #define PI acos(-1.0)
- #define size1 1000007
- int drx[8] = {-2,-2,-1,-1,1,1,2,2};
- int dcy[8] = {-1,1,-2,2,-2,2,-1,1};
- int dirx[4] = { -1, 0, 1, 0 };
- int diry[4] = { 0, -1, 0, 1 };
- ll gcd(ll a,ll b){ if(b == 0) return a; return gcd(b, a % b); }
- ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
- int main()
- {
- ll tc, num, t = 1, pownum;
- // freopen("/opt/Coding/clion code/input.txt", "r", stdin);
- // freopen("/opt/Coding/clion code/output.txt", "w", stdout);
- while (cin >> num){
- if(num <= 1 || num >= 50) break;
- ll arr[num];
- for(ll i = 0; i < num; i++)
- sc1(arr[i]);
- ll cnt = 0;
- for(ll i = 0; i < num - 1; i++){
- for(ll j = i + 1; j < num; j++){
- if(gcd(arr[i], arr[j]) == 1) cnt++;
- }
- }
- if(cnt == 0) cout << "No estimate for this data set." << endl;
- else{
- ll sum = num * (num - 1) / 2;
- double ans = sqrt((6.0 * sum) / cnt);
- printf("%.6lf\n", ans);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement