#include <stdio.h>
#include <algorithm>
#include <utility>
#include <vector>
#define INF 2000000000
#define MAX 1000000

using namespace std;

typedef pair<int, int> pii;

int max1[8 * MAX + 5], min1[8 * MAX + 5], v[MAX + 5], c[MAX + 5], opt[MAX + 5];
vector<int> v1, v2;

void init(int node, int b, int e) {
    if (b == e) {
        max1[node] = v[b] * 100;
        min1[node] = c[b];
        return;
    }
    init(2 * node, b, (b + e) / 2);
    init(2 * node + 1, (b + e) / 2 + 1, e);
    max1[node] = max(max1[2 * node], max1[2 * node + 1]);
    min1[node] = min(min1[2 * node], min1[2 * node + 1]);
}

pii query(int node, int b, int e, int i, int j) {
    pii pii1, pii2;
    if (b > j || e < i) {
        return pii(INF, 0);
    }
    if (b >= i && e <= j) {
        return pii(min1[node], max1[node]);
    }
    pii1 = query(2 * node, b, (b + e) / 2, i, j);
    pii2 = query(2 * node + 1, (b + e) /2 + 1, e, i, j);
    return pii(min(pii1.first, pii2.first), max(pii1.second, pii2.second));
}

int main() {
    int n, k, i, j, min2, max2, m, lo, hi, mid;
    double ans, rp;
    pii ret;
    scanf("%d%d", &n, &k);
    for (i = 0; i < n; i++) {
        scanf("%d", &v[i]);
    }
    for (i = 0; i < n; i++) {
        scanf("%d", &c[i]);
    }
    init(1, 0, n - 1);
    j = 0;
    for (i = 0; i < n; i++) {
        lo = i;
        hi = n - 1;
        while (lo < hi) {
            mid = (lo + hi + 1) / 2;
            ret = query(1, 0, n - 1, i, mid);
            if (ret.second <= ret.first) {
                lo = mid;
            } else {
                hi = mid - 1;
            }
        }
        ret = query(1, 0, n - 1, i, lo);
        opt[i] = min(ret.first, ret.second);
    }
    ans = 0.0;
    sort(opt, opt + n);
    for (i = n - k; i >= 0; i--) {
        m = n - 1 - i;
        if (i == n - k) {
            rp = k * 1.0;
            for (j = m - k + 2; j <= n - k; j++) {
                v1.push_back(j);
            }
            for (j = m + 1; j <= n; j++) {
                v2.push_back(j);
            }
            for (j = 0; j < v1.size() || j < v2.size(); j++) {
                if (j < v1.size()) {
                    rp *= v1[j];
                }
                if (j < v2.size()) {
                    rp /= v2[j];
                }
            }
        } else {
            rp *= m;
            if (m - 1 - k + 2 >= 1 && m - 1 - k + 2 <= n - k) {
                rp /= m - 1 - k + 2;
            }
        }
        ans += rp * opt[i];
    }
    printf("%.10lf\n", ans);
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <utility>
#include <vector>
#include <assert.h>
#define INF 2000000000
#define MAX 1000000

using namespace std;

typedef pair<int, int> pii;

int max1[8 * MAX + 5], min1[8 * MAX + 5], v[MAX + 5], c[MAX + 5], opt[MAX + 5];

void init(int node, int b, int e) {
    if (b == e) {
        max1[node] = v[b] * 100;
        min1[node] = c[b];
        return;
    }
    init(2 * node, b, (b + e) / 2);
    init(2 * node + 1, (b + e) / 2 + 1, e);
    max1[node] = max(max1[2 * node], max1[2 * node + 1]);
    min1[node] = min(min1[2 * node], min1[2 * node + 1]);
}

pii query(int node, int b, int e, int i, int j) {
    pii pii1, pii2;
    if (b > j || e < i) {
        return pii(INF, 0);
    }
    if (b >= i && e <= j) {
        return pii(min1[node], max1[node]);
    }
    pii1 = query(2 * node, b, (b + e) / 2, i, j);
    pii2 = query(2 * node + 1, (b + e) /2 + 1, e, i, j);
    return pii(min(pii1.first, pii2.first), max(pii1.second, pii2.second));
}

int main() {
    int n, k, i, j, min2, max2, lo, hi, mid, u, d;
    double ans, rp;
    pii ret;
    scanf("%d%d", &n, &k);
    for (i = 0; i < n; i++) {
        scanf("%d", &v[i]);
    }
    for (i = 0; i < n; i++) {
        scanf("%d", &c[i]);
    }
    init(1, 0, n - 1);
    j = 0;
    for (i = 0; i < n; i++) {
        lo = i;
        hi = n - 1;
        while (lo < hi) {
            mid = (lo + hi + 1) / 2;
            ret = query(1, 0, n - 1, i, mid);
            if (ret.second <= ret.first) {
                lo = mid;
            } else {
                hi = mid - 1;
            }
        }
        ret = query(1, 0, n - 1, i, lo);
        opt[i] = min(ret.first, ret.second);
        if (lo + 1 < n) {
            ret = query(1, 0, n - 1, i, lo + 1);
            opt[i] = max(opt[i], min(ret.first, ret.second));
        }
    }
    ans = 0.0;
    sort(opt, opt + n);
    for (i = 0; i <= n - k; i++) {
        if (i == 0) {
            rp = (k * 1.0) / n;
        } else {
            if (i == 1) {
                u = n - k;
                d = n - 1;
            } else {
                u++;
                d--;
            }
            rp *= u;
            rp /= d;
        }
        ans += rp * opt[i];
    }
    printf("%.10lf\n", ans);
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <utility>
#include <vector>
#include <assert.h>
#define INF 2000000000
#define MAX 1000005
#define MAXB 25

using namespace std;

typedef pair<int, int> pii;

int max1[MAX][MAXB], min1[MAX][MAXB], v[MAX], c[MAX], opt[MAX];

int main() {
    int n, k, i, j, min2, max2, lo, hi, mid, u, d, st, lim;
    double ans, rp;
    pii ret;
    scanf("%d%d", &n, &k);
    for (i = 0; i < n; i++) {
        scanf("%d", &v[i]);
    }
    for (i = 0; i < n; i++) {
        scanf("%d", &c[i]);
    }
    for (i = 0; i < n; i++) {
        max1[i][0] = v[i] * 100;
        min1[i][0] = c[i];
    }
    for (i = 0; (1 << (i + 1)) <= n; i++) {
        lim = i + 1;
        for (j = 0; j < n; j++) {
            if (j + (1 << (i + 1)) - 1 < n) {
                max1[j][i + 1] = max(max1[j][i], max1[j + (1 << i)][i]);
                min1[j][i + 1] = min(min1[j][i], min1[j + (1 << i)][i]);
            } else {
                max1[j][i] = -1;
                min1[j][i] = -1;
            }
        }
    }
    for (i = 0; i < n; i++) {
        max2 = v[i] * 100;
        min2 = c[i];
        st = i;
        for (j = lim; j >= 0 && st < n; j--) {
            if (max1[st][j] == -1) {
                continue;
            }
            if (min(max(max2, max1[st][j]), min(min2, min1[st][j])) >= min(max2, min2)) {
                max2 = max(max2, max1[st][j]);
                min2 = min(min2, min1[st][j]);
                st += (1 << j);
            }
        }
        opt[i] = min(max2, min2);
        assert(max2 <= min2);
    }
    ans = 0.0;
    sort(opt, opt + n);
    for (i = 0; i <= n - k; i++) {
        if (i == 0) {
            rp = (k * 1.0) / n;
        } else {
            if (i == 1) {
                u = n - k;
                d = n - 1;
            } else {
                u--;
                d--;
            }
            rp *= u;
            rp /= d;
        }
        ans += rp * opt[i];
    }
    printf("%.10lf\n", ans);
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <utility>
#include <vector>
#define INF 2000000000
#define MAX 1000000

using namespace std;

typedef pair<int, int> pii;

int max1[8 * MAX + 5], min1[8 * MAX + 5], v[MAX + 5], c[MAX + 5], opt[MAX + 5];
vector<int> v1, v2;

void init(int node, int b, int e) {
    if (b == e) {
        max1[node] = v[b] * 100;
        min1[node] = c[b];
        return;
    }
    init(2 * node, b, (b + e) / 2);
    init(2 * node + 1, (b + e) / 2 + 1, e);
    max1[node] = max(max1[2 * node], max1[2 * node + 1]);
    min1[node] = min(min1[2 * node], min1[2 * node + 1]);
}

pii query(int node, int b, int e, int i, int j) {
    pii pii1, pii2;
    if (b > j || e < i) {
        return pii(INF, 0);
    }
    if (b >= i && e <= j) {
        return pii(min1[node], max1[node]);
    }
    pii1 = query(2 * node, b, (b + e) / 2, i, j);
    pii2 = query(2 * node + 1, (b + e) /2 + 1, e, i, j);
    return pii(min(pii1.first, pii2.first), max(pii1.second, pii2.second));
}

int main() {
    int n, k, i, j, min2, max2, m;
    double ans, rp;
    pii ret;
    scanf("%d%d", &n, &k);
    for (i = 0; i < n; i++) {
        scanf("%d", &v[i]);
    }
    for (i = 0; i < n; i++) {
        scanf("%d", &c[i]);
    }
    init(1, 0, n - 1);
    j = 0;
    for (i = 0; i < n; i++) {
        j = max(i, j);
        ret = query(1, 0, n - 1, i, j);
        min2 = ret.first;
        max2 = ret.second;
        j++;
        while (j < n) {
            ret = query(1, 0, n - 1, i, j);
            min2 = min(min2, ret.first);
            max2 = max(max2, ret.second);
            if (max2 > min2) {
                break;
            }
            j++;
        }
        j--;
        ret = query(1, 0, n - 1, i, j);
        opt[i] = min(ret.first, ret.second);
    }
    ans = 0.0;
    sort(opt, opt + n);
    for (i = n - k; i >= 0; i--) {
        m = n - 1 - i;
        if (i == n - k) {
            rp = k * 1.0;
            for (j = m - k + 2; j <= n - k; j++) {
                v1.push_back(j);
            }
            for (j = m + 1; j <= n; j++) {
                v2.push_back(j);
            }
            for (j = 0; j < v1.size() || j < v2.size(); j++) {
                if (j < v1.size()) {
                    rp *= v1[j];
                }
                if (j < v2.size()) {
                    rp /= v2[j];
                }
            }
        } else {
            rp *= m;
            if (m - 1 - k + 2 >= 1 && m - 1 - k + 2 <= n - k) {
                rp /= m - 1 - k + 2;
            }
        }
        ans += rp * opt[i];
    }
    printf("%.10lf\n", ans);
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <utility>
#include <vector>
#define INF 2000000000
#define MAX 1000000

using namespace std;

typedef pair<int, int> pii;

int max1[8 * MAX + 5], min1[8 * MAX + 5], v[MAX + 5], c[MAX + 5], opt[MAX + 5];
vector<int> v1, v2;

void init(int node, int b, int e) {
    if (b == e) {
        max1[node] = v[b] * 100;
        min1[node] = c[b];
        return;
    }
    init(2 * node, b, (b + e) / 2);
    init(2 * node + 1, (b + e) / 2 + 1, e);
    max1[node] = max(max1[2 * node], max1[2 * node + 1]);
    min1[node] = min(min1[2 * node], min1[2 * node + 1]);
}

pii query(int node, int b, int e, int i, int j) {
    pii pii1, pii2;
    if (b > j || e < i) {
        return pii(INF, 0);
    }
    if (b >= i && e <= j) {
        return pii(min1[node], max1[node]);
    }
    pii1 = query(2 * node, b, (b + e) / 2, i, j);
    pii2 = query(2 * node + 1, (b + e) /2 + 1, e, i, j);
    return pii(min(pii1.first, pii2.first), max(pii1.second, pii2.second));
}

int main() {
    int n, k, i, j, min2, max2, m, lo, hi, mid;
    double ans, rp;
    pii ret;
    scanf("%d%d", &n, &k);
    for (i = 0; i < n; i++) {
        scanf("%d", &v[i]);
    }
    for (i = 0; i < n; i++) {
        scanf("%d", &c[i]);
    }
    init(1, 0, n - 1);
    j = 0;
    for (i = 0; i < n; i++) {
        lo = i;
        hi = n - 1;
        while (lo < hi) {
            mid = (lo + hi + 1) / 2;
            ret = query(1, 0, n - 1, i, mid);
            if (ret.second <= ret.first) {
                lo = mid;
            } else {
                hi = mid - 1;
            }
        }
        ret = query(1, 0, n - 1, i, lo);
        opt[i] = min(ret.first, ret.second);
        if (lo + 1 < n) {
            ret = query(1, 0, n - 1, i, lo + 1);
            opt[i] = max(opt[i], min(ret.first, ret.second));
        }
    }
    ans = 0.0;
    sort(opt, opt + n);
    for (i = n - k; i >= 0; i--) {
        m = n - 1 - i;
        if (i == n - k) {
            rp = k * 1.0;
            for (j = m - k + 2; j <= n - k; j++) {
                v1.push_back(j);
            }
            for (j = m + 1; j <= n; j++) {
                v2.push_back(j);
            }
            reverse(v2.begin(), v2.end());
            for (j = 0; j < v1.size() || j < v2.size(); j++) {
                if (j < v1.size()) {
                    rp *= v1[j];
                }
                if (j < v2.size()) {
                    rp /= v2[j];
                }
            }
        } else {
            rp *= m;
            if (m - 1 - k + 2 >= 1 && m - 1 - k + 2 <= n - k) {
                rp /= m - 1 - k + 2;
            }
        }
        ans += rp * opt[i];
    }
    printf("%.10lf\n", ans);
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <utility>
#include <vector>
#include <assert.h>
#define INF 2000000000
#define MAX 1000000

using namespace std;

typedef pair<int, int> pii;

int max1[8 * MAX + 5], min1[8 * MAX + 5], v[MAX + 5], c[MAX + 5], opt[MAX + 5];

void init(int node, int b, int e) {
    if (b == e) {
        max1[node] = v[b] * 100;
        min1[node] = c[b];
        return;
    }
    init(2 * node, b, (b + e) / 2);
    init(2 * node + 1, (b + e) / 2 + 1, e);
    max1[node] = max(max1[2 * node], max1[2 * node + 1]);
    min1[node] = min(min1[2 * node], min1[2 * node + 1]);
}

pii query(int node, int b, int e, int i, int j) {
    pii pii1, pii2;
    if (b > j || e < i) {
        return pii(INF, 0);
    }
    if (b >= i && e <= j) {
        return pii(min1[node], max1[node]);
    }
    pii1 = query(2 * node, b, (b + e) / 2, i, j);
    pii2 = query(2 * node + 1, (b + e) /2 + 1, e, i, j);
    return pii(min(pii1.first, pii2.first), max(pii1.second, pii2.second));
}

int main() {
    int n, k, i, j, min2, max2, lo, hi, mid, u, d;
    double ans, rp;
    pii ret;
    scanf("%d%d", &n, &k);
    for (i = 0; i < n; i++) {
        scanf("%d", &v[i]);
    }
    for (i = 0; i < n; i++) {
        scanf("%d", &c[i]);
    }
    init(1, 0, n - 1);
    j = 0;
    for (i = 0; i < n; i++) {
        lo = i;
        hi = n - 1;
        while (lo < hi) {
            mid = (lo + hi + 1) / 2;
            ret = query(1, 0, n - 1, i, mid);
            if (ret.second <= ret.first) {
                lo = mid;
            } else {
                hi = mid - 1;
            }
        }
        ret = query(1, 0, n - 1, i, lo);
        opt[i] = min(ret.first, ret.second);
        if (lo + 1 < n) {
            ret = query(1, 0, n - 1, i, lo + 1);
            opt[i] = max(opt[i], min(ret.first, ret.second));
        }
    }
    ans = 0.0;
    sort(opt, opt + n);
    for (i = 0; i <= n - k; i++) {
        if (i == 0) {
            rp = (k * 1.0) / n;
        } else {
            if (i == 1) {
                u = n - k;
                d = n - 1;
            } else {
                u--;
                d--;
            }
            rp *= u;
            rp /= d;
        }
        ans += rp * opt[i];
    }
    printf("%.10lf\n", ans);
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <utility>
#include <vector>
#define INF 2000000000
#define MAX 1000000

using namespace std;

typedef pair<int, int> pii;

int max1[8 * MAX + 5], min1[8 * MAX + 5], v[MAX + 5], c[MAX + 5], opt[MAX + 5];
vector<int> v1, v2;

void init(int node, int b, int e) {
    if (b == e) {
        max1[node] = v[b] * 100;
        min1[node] = c[b];
        return;
    }
    init(2 * node, b, (b + e) / 2);
    init(2 * node + 1, (b + e) / 2 + 1, e);
    max1[node] = max(max1[2 * node], max1[2 * node + 1]);
    min1[node] = min(min1[2 * node], min1[2 * node + 1]);
}

pii query(int node, int b, int e, int i, int j) {
    pii pii1, pii2;
    if (b > j || e < i) {
        return pii(INF, 0);
    }
    if (b >= i && e <= j) {
        return pii(min1[node], max1[node]);
    }
    pii1 = query(2 * node, b, (b + e) / 2, i, j);
    pii2 = query(2 * node + 1, (b + e) /2 + 1, e, i, j);
    return pii(min(pii1.first, pii2.first), max(pii1.second, pii2.second));
}

int main() {
    int n, k, i, j, min2, max2, m, lo, hi, mid;
    double ans, rp;
    pii ret;
    scanf("%d%d", &n, &k);
    for (i = 0; i < n; i++) {
        scanf("%d", &v[i]);
    }
    for (i = 0; i < n; i++) {
        scanf("%d", &c[i]);
    }
    init(1, 0, n - 1);
    j = 0;
    for (i = 0; i < n; i++) {
        lo = i;
        hi = n - 1;
        while (lo < hi) {
            mid = (lo + hi + 1) / 2;
            ret = query(1, 0, n - 1, i, mid);
            if (ret.second <= ret.first) {
                lo = mid;
            } else {
                hi = mid - 1;
            }
        }
        ret = query(1, 0, n - 1, i, lo);
        opt[i] = min(ret.first, ret.second);
        if (lo + 1 < n) {
            ret = query(1, 0, n - 1, i, lo + 1);
            opt[i] = max(opt[i], min(ret.first, ret.second));
        }
    }
    ans = 0.0;
    sort(opt, opt + n);
    for (i = n - k; i >= 0; i--) {
        m = n - 1 - i;
        if (i == n - k) {
            rp = k * 1.0;
            for (j = m - k + 2; j <= n - k; j++) {
                v1.push_back(j);
            }
            for (j = m + 1; j <= n; j++) {
                v2.push_back(j);
            }
            for (j = 0; j < v1.size() || j < v2.size(); j++) {
                if (j < v1.size()) {
                    rp *= v1[j];
                }
                if (j < v2.size()) {
                    rp /= v2[j];
                }
            }
        } else {
            rp *= m;
            if (m - 1 - k + 2 >= 1 && m - 1 - k + 2 <= n - k) {
                rp /= m - 1 - k + 2;
            }
        }
        ans += rp * opt[i];
    }
    printf("%.10lf\n", ans);
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <utility>
#include <vector>
#include <assert.h>
#define INF 2000000000
#define MAX 1000005
#define MAXB 25

using namespace std;

typedef pair<int, int> pii;

int max1[MAX][MAXB], min1[MAX][MAXB], v[MAX], c[MAX], opt[MAX], po[MAX];

int main() {
    int n, k, i, j, min2, max2, lo, hi, mid, u, d, st, lim, p;
    double ans, rp;
    pii ret;
    scanf("%d%d", &n, &k);
    for (i = 0; i < n; i++) {
        scanf("%d", &v[i]);
    }
    for (i = 0; i < n; i++) {
        scanf("%d", &c[i]);
    }
    for (i = 1; i <= n; i++) {
        for (j = 0; (1 << j) <= i; j++) {}
        po[i] = j -1;
    }
    for (i = 0; i < n; i++) {
        max1[i][0] = v[i] * 100;
        min1[i][0] = c[i];
    }
    for (i = 0; (1 << (i + 1)) <= n; i++) {
        lim = i + 1;
        for (j = 0; j < n; j++) {
            if (j + (1 << (i + 1)) - 1 < n) {
                max1[j][i + 1] = max(max1[j][i], max1[j + (1 << i)][i]);
                min1[j][i + 1] = min(min1[j][i], min1[j + (1 << i)][i]);
            } else {
                max1[j][i + 1] = -1;
                min1[j][i + 1] = -1;
            }
        }
    }
    for (i = 0; i < n; i++) {
        lo = i;
        hi = n - 1;
        while (lo < hi) {
            mid = (lo + hi + 1) / 2;
            p = po[mid - i + 1];
            max2 = max(max1[i][p], max1[mid - (1 << p) + 1][p]);
            min2 = min(min1[i][p], min1[mid - (1 << p) + 1][p]);
            if (max2 <= min2) {
                lo = mid;
            } else {
                hi = mid - 1;
            }
        }
        p = po[lo - i + 1];
        max2 = max(max1[i][p], max1[lo - (1 << p) + 1][p]);
        min2 = min(min1[i][p], min1[lo - (1 << p) + 1][p]);
        opt[i] = min(max2, min2);
        if (lo + 1 < n) {
            lo++;
            p = po[lo - i + 1];
            max2 = max(max1[i][p], max1[lo - (1 << p) + 1][p]);
            min2 = min(min1[i][p], min1[lo - (1 << p) + 1][p]);
            opt[i] = max(opt[i], min(max2, min2));
        }
    }
    ans = 0.0;
    sort(opt, opt + n);
    for (i = 0; i <= n - k; i++) {
        if (i == 0) {
            rp = (k * 1.0) / n;
        } else {
            if (i == 1) {
                u = n - k;
                d = n - 1;
            } else {
                u--;
                d--;
            }
            rp *= u;
            rp /= d;
        }
        ans += rp * opt[i];
    }
    printf("%.10lf\n", ans);
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <utility>
#include <vector>
#include <assert.h>
#define INF 2000000000
#define MAX 1000000

using namespace std;

typedef pair<int, int> pii;

int max1[8 * MAX + 5], min1[8 * MAX + 5], v[MAX + 5], c[MAX + 5], opt[MAX + 5];
vector<int> v1, v2;

void init(int node, int b, int e) {
    if (b == e) {
        max1[node] = v[b] * 100;
        min1[node] = c[b];
        return;
    }
    init(2 * node, b, (b + e) / 2);
    init(2 * node + 1, (b + e) / 2 + 1, e);
    max1[node] = max(max1[2 * node], max1[2 * node + 1]);
    min1[node] = min(min1[2 * node], min1[2 * node + 1]);
}

pii query(int node, int b, int e, int i, int j) {
    pii pii1, pii2;
    if (b > j || e < i) {
        return pii(INF, 0);
    }
    if (b >= i && e <= j) {
        return pii(min1[node], max1[node]);
    }
    pii1 = query(2 * node, b, (b + e) / 2, i, j);
    pii2 = query(2 * node + 1, (b + e) /2 + 1, e, i, j);
    return pii(min(pii1.first, pii2.first), max(pii1.second, pii2.second));
}

int main() {
    int n, k, i, j, min2, max2, m, lo, hi, mid;
    double ans, rp;
    pii ret;
    scanf("%d%d", &n, &k);
    for (i = 0; i < n; i++) {
        scanf("%d", &v[i]);
    }
    for (i = 0; i < n; i++) {
        scanf("%d", &c[i]);
    }
    init(1, 0, n - 1);
    j = 0;
    for (i = 0; i < n; i++) {
        lo = i;
        hi = n - 1;
        while (lo < hi) {
            mid = (lo + hi + 1) / 2;
            ret = query(1, 0, n - 1, i, mid);
            if (ret.second <= ret.first) {
                lo = mid;
            } else {
                hi = mid - 1;
            }
        }
        ret = query(1, 0, n - 1, i, lo);
        opt[i] = min(ret.first, ret.second);
        if (lo + 1 < n) {
            ret = query(1, 0, n - 1, i, lo + 1);
            opt[i] = max(opt[i], min(ret.first, ret.second));
        }
    }
    ans = 0.0;
    sort(opt, opt + n);
    for (i = n - k; i >= 0; i--) {
        m = n - 1 - i;
        if (i == n - k) {
            rp = k * 1.0;
            for (j = m - k + 2; j <= n - k; j++) {
                v1.push_back(j);
            }
            for (j = m + 1; j <= n; j++) {
                v2.push_back(j);
            }
            for (j = 0; j < v1.size() || j < v2.size(); j++) {
                if (j < v1.size()) {
                    rp *= v1[j];
                }
                if (j < v2.size()) {
                    rp /= v2[j];
                }
            }
        } else {
            rp *= m;
            if (m - 1 - k + 2 >= 1 && m - 1 - k + 2 <= n - k) {
                rp /= m - 1 - k + 2;
            }
        }
        assert(opt[i] > 0);
        assert(rp > 0.0);
        ans += rp * opt[i];
    }
    printf("%.10lf\n", ans);
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <utility>
#include <vector>
#include <assert.h>
#define INF 2000000000
#define MAX 1000005
#define MAXB 25

using namespace std;

typedef pair<int, int> pii;

int max1[MAX][MAXB], min1[MAX][MAXB], v[MAX], c[MAX], opt[MAX];

int main() {
    int n, k, i, j, min2, max2, lo, hi, mid, u, d, st, lim;
    double ans, rp;
    pii ret;
    scanf("%d%d", &n, &k);
    for (i = 0; i < n; i++) {
        scanf("%d", &v[i]);
    }
    for (i = 0; i < n; i++) {
        scanf("%d", &c[i]);
    }
    for (i = 0; i < n; i++) {
        max1[i][0] = v[i] * 100;
        min1[i][0] = c[i];
    }
    for (i = 0; (1 << (i + 1)) <= n; i++) {
        lim = i + 1;
        for (j = 0; j < n; j++) {
            if (j + (1 << (i + 1)) - 1 < n) {
                max1[j][i + 1] = max(max1[j][i], max1[j + (1 << i)][i]);
                min1[j][i + 1] = min(min1[j][i], min1[j + (1 << i)][i]);
            } else {
                max1[j][i] = -1;
                min1[j][i] = -1;
            }
        }
    }
    for (i = 0; i < n; i++) {
        max2 = v[i] * 100;
        min2 = c[i];
        st = i;
        for (j = lim; j >= 0 && st < n; j--) {
            if (max1[st][j] == -1) {
                continue;
            }
            if (min(max(max2, max1[st][j]), min(min2, min1[st][j])) >= min(max2, min2)) {
                max2 = max(max2, max1[st][j]);
                min2 = min(min2, min1[st][j]);
                st += (1 << j);
            }
        }
        opt[i] = min(max2, min2);
    }
    ans = 0.0;
    sort(opt, opt + n);
    for (i = 0; i <= n - k; i++) {
        if (i == 0) {
            rp = (k * 1.0) / n;
        } else {
            if (i == 1) {
                u = n - k;
                d = n - 1;
            } else {
                u--;
                d--;
            }
            rp *= u;
            rp /= d;
        }
        ans += rp * opt[i];
    }
    printf("%.10lf\n", ans);
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <utility>
#include <vector>
#define INF 2000000000
#define MAX 1000000

using namespace std;

typedef pair<int, int> pii;

int max1[8 * MAX + 5], min1[8 * MAX + 5], v[MAX + 5], c[MAX + 5], opt[MAX + 5];
vector<int> v1, v2;

void init(int node, int b, int e) {
    if (b == e) {
        max1[node] = v[b] * 100;
        min1[node] = c[b];
        return;
    }
    init(2 * node, b, (b + e) / 2);
    init(2 * node + 1, (b + e) / 2 + 1, e);
    max1[node] = max(max1[2 * node], max1[2 * node + 1]);
    min1[node] = min(min1[2 * node], min1[2 * node + 1]);
}

pii query(int node, int b, int e, int i, int j) {
    pii pii1, pii2;
    if (b > j || e < i) {
        return pii(INF, 0);
    }
    if (b >= i && e <= j) {
        return pii(min1[node], max1[node]);
    }
    pii1 = query(2 * node, b, (b + e) / 2, i, j);
    pii2 = query(2 * node + 1, (b + e) /2 + 1, e, i, j);
    return pii(min(pii1.first, pii2.first), max(pii1.second, pii2.second));
}

int main() {
    int n, k, i, j, min2, max2, m, lo, hi, mid;
    double ans, rp;
    pii ret;
    scanf("%d%d", &n, &k);
    for (i = 0; i < n; i++) {
        scanf("%d", &v[i]);
    }
    for (i = 0; i < n; i++) {
        scanf("%d", &c[i]);
    }
    init(1, 0, n - 1);
    j = 0;
    for (i = 0; i < n; i++) {
        lo = i;
        hi = n - 1;
        while (lo < hi) {
            mid = (lo + hi + 1) / 2;
            ret = query(1, 0, n - 1, i, mid);
            if (ret.second <= ret.first) {
                lo = mid;
            } else {
                hi = mid - 1;
            }
        }
        ret = query(1, 0, n - 1, i, lo);
        opt[i] = min(ret.first, ret.second);
    }
    ans = 0.0;
    sort(opt, opt + n);
    for (i = n - k; i >= 0; i--) {
        m = n - 1 - i;
        if (i == n - k) {
            rp = k * 1.0;
            for (j = m - k + 2; j <= n - k; j++) {
                v1.push_back(j);
            }
            for (j = m + 1; j <= n; j++) {
                v2.push_back(j);
            }
            reverse(v2.begin(), v2.end());
            for (j = 0; j < v1.size() || j < v2.size(); j++) {
                if (j < v1.size()) {
                    rp *= v1[j];
                }
                if (j < v2.size()) {
                    rp /= v2[j];
                }
            }
        } else {
            rp *= m;
            if (m - 1 - k + 2 >= 1 && m - 1 - k + 2 <= n - k) {
                rp /= m - 1 - k + 2;
            }
        }
        ans += rp * opt[i];
    }
    printf("%.10lf\n", ans);
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <utility>
#include <vector>
#define INF 2000000000
#define MAX 1000000

using namespace std;

typedef pair<int, int> pii;

int max1[8 * MAX + 5], min1[8 * MAX + 5], v[MAX + 5], c[MAX + 5], opt[MAX + 5];
vector<int> v1, v2;

void init(int node, int b, int e) {
    if (b == e) {
        max1[node] = v[b] * 100;
        min1[node] = c[b];
        return;
    }
    init(2 * node, b, (b + e) / 2);
    init(2 * node + 1, (b + e) / 2 + 1, e);
}

pii query(int node, int b, int e, int i, int j) {
    pii pii1, pii2;
    if (b > j || e < i) {
        return pii(INF, 0);
    }
    if (b >= i && e <= j) {
        return pii(min1[node], max1[node]);
    }
    pii1 = query(2 * node, b, (b + e) / 2, i, j);
    pii2 = query(2 * node + 1, (b + e) /2 + 1, e, i, j);
    return pii(min(pii1.first, pii2.first), max(pii1.second, pii2.second));
}

int main() {
    int n, k, i, j, min2, max2, m;
    double ans, rp;
    pii ret;
    scanf("%d%d", &n, &k);
    for (i = 0; i < n; i++) {
        scanf("%d", &v[i]);
    }
    for (i = 0; i < n; i++) {
        scanf("%d", &c[i]);
    }
    init(1, 0, n - 1);
    j = 0;
    for (i = 0; i < n; i++) {
        j = max(j, i);
        ret = query(1, 0, n - 1, i, j);
        min2 = ret.first;
        max2 = ret.second;
        j++;
        while (j < n) {
            min2 = min(min2, c[j]);
            max2 = max(max2, v[j] * 100);
            if (min2 < max2) {
                break;
            }
            j++;
        }
        ret = query(1, 0, n - 1, i, j - 1);
        opt[i] = min(ret.first, ret.second);
    }
    ans = 0.0;
    sort(opt, opt + n);
    for (i = n - k; i >= 0; i--) {
        m = n - 1 - i;
        if (i == n - k) {
            rp = k * 1.0;
            for (j = m - k + 2; j <= n - k; j++) {
                v1.push_back(j);
            }
            for (j = m + 1; j <= n; j++) {
                v2.push_back(j);
            }
            for (j = 0; j < v1.size() || j < v2.size(); j++) {
                if (j < v1.size()) {
                    rp *= v1[j];
                }
                if (j < v2.size()) {
                    rp /= v2[j];
                }
            }
        } else {
            rp *= m;
            if (m - 1 - k + 2 >= 1 && m - 1 - k + 2 <= n - k) {
                rp /= m - 1 - k + 2;
            }
        }
        ans += rp * opt[i];
    }
    printf("%.10lf\n", ans);
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <utility>
#include <vector>
#include <assert.h>
#define INF 2000000000
#define MAX 1000000

using namespace std;

typedef pair<int, int> pii;

int max1[8 * MAX + 5], min1[8 * MAX + 5], v[MAX + 5], c[MAX + 5], opt[MAX + 5];
vector<int> v1, v2;

void init(int node, int b, int e) {
    if (b == e) {
        max1[node] = v[b] * 100;
        min1[node] = c[b];
        return;
    }
    init(2 * node, b, (b + e) / 2);
    init(2 * node + 1, (b + e) / 2 + 1, e);
    max1[node] = max(max1[2 * node], max1[2 * node + 1]);
    min1[node] = min(min1[2 * node], min1[2 * node + 1]);
}

pii query(int node, int b, int e, int i, int j) {
    pii pii1, pii2;
    if (b > j || e < i) {
        return pii(INF, 0);
    }
    if (b >= i && e <= j) {
        return pii(min1[node], max1[node]);
    }
    pii1 = query(2 * node, b, (b + e) / 2, i, j);
    pii2 = query(2 * node + 1, (b + e) /2 + 1, e, i, j);
    return pii(min(pii1.first, pii2.first), max(pii1.second, pii2.second));
}

int main() {
    int n, k, i, j, min2, max2, m, lo, hi, mid;
    double ans, rp;
    pii ret;
    scanf("%d%d", &n, &k);
    for (i = 0; i < n; i++) {
        scanf("%d", &v[i]);
    }
    for (i = 0; i < n; i++) {
        scanf("%d", &c[i]);
    }
    init(1, 0, n - 1);
    j = 0;
    for (i = 0; i < n; i++) {
        lo = i;
        hi = n - 1;
        while (lo < hi) {
            mid = (lo + hi + 1) / 2;
            ret = query(1, 0, n - 1, i, mid);
            if (ret.second <= ret.first) {
                lo = mid;
            } else {
                hi = mid - 1;
            }
        }
        ret = query(1, 0, n - 1, i, lo);
        opt[i] = min(ret.first, ret.second);
        if (lo + 1 < n) {
            ret = query(1, 0, n - 1, i, lo + 1);
            opt[i] = max(opt[i], min(ret.first, ret.second));
        }
    }
    ans = 0.0;
    sort(opt, opt + n);
    for (i = n - k; i >= 0; i--) {
        m = n - 1 - i;
        if (i == n - k) {
            rp = 1.0;
            v1.push_back(k);
            for (j = m - k + 2; j <= n - k; j++) {
                v1.push_back(j);
            }
            for (j = m + 1; j <= n; j++) {
                v2.push_back(j);
            }
            for (j = 0; j < v1.size() || j < v2.size(); j++) {
                if (j < v1.size()) {
                    rp *= v1[j];
                }
                if (j < v2.size()) {
                    rp /= v2[j];
                }
            }
        } else {
            rp *= m;
            rp /= m - 1 - k + 2;
        }
        //assert(opt[i] > 0);
        //assert(rp > 0.0);
        ans += rp * opt[i];
    }
    printf("%.10lf\n", ans);
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <utility>
#include <vector>
#include <assert.h>
#define INF 2000000000
#define MAX 1000000

using namespace std;

typedef pair<int, int> pii;

int max1[8 * MAX + 5], min1[8 * MAX + 5], v[MAX + 5], c[MAX + 5], opt[MAX + 5];
vector<int> v1, v2;

void init(int node, int b, int e) {
    if (b == e) {
        max1[node] = v[b] * 100;
        min1[node] = c[b];
        return;
    }
    init(2 * node, b, (b + e) / 2);
    init(2 * node + 1, (b + e) / 2 + 1, e);
    max1[node] = max(max1[2 * node], max1[2 * node + 1]);
    min1[node] = min(min1[2 * node], min1[2 * node + 1]);
}

pii query(int node, int b, int e, int i, int j) {
    pii pii1, pii2;
    if (b > j || e < i) {
        return pii(INF, 0);
    }
    if (b >= i && e <= j) {
        return pii(min1[node], max1[node]);
    }
    pii1 = query(2 * node, b, (b + e) / 2, i, j);
    pii2 = query(2 * node + 1, (b + e) /2 + 1, e, i, j);
    return pii(min(pii1.first, pii2.first), max(pii1.second, pii2.second));
}

int main() {
    int n, k, i, j, min2, max2, m, lo, hi, mid;
    double ans, rp;
    pii ret;
    scanf("%d%d", &n, &k);
    for (i = 0; i < n; i++) {
        scanf("%d", &v[i]);
    }
    for (i = 0; i < n; i++) {
        scanf("%d", &c[i]);
    }
    init(1, 0, n - 1);
    j = 0;
    for (i = 0; i < n; i++) {
        lo = i;
        hi = n - 1;
        while (lo < hi) {
            mid = (lo + hi + 1) / 2;
            ret = query(1, 0, n - 1, i, mid);
            if (ret.second <= ret.first) {
                lo = mid;
            } else {
                hi = mid - 1;
            }
        }
        ret = query(1, 0, n - 1, i, lo);
        opt[i] = min(ret.first, ret.second);
        if (lo + 1 < n) {
            ret = query(1, 0, n - 1, i, lo + 1);
            opt[i] = max(opt[i], min(ret.first, ret.second));
        }
    }
    ans = 0.0;
    sort(opt, opt + n);
    for (i = n - k; i >= 0; i--) {
        m = n - 1 - i;
        if (i == n - k) {
            rp = k * 1.0;
            for (j = m - k + 2; j <= n - k; j++) {
                v1.push_back(j);
            }
            for (j = m + 1; j <= n; j++) {
                v2.push_back(j);
            }
            for (j = 0; j < v1.size() || j < v2.size(); j++) {
                if (j < v1.size()) {
                    rp *= v1[j];
                }
                if (j < v2.size()) {
                    rp /= v2[j];
                }
            }
        } else {
            rp *= m;
            rp /= m - 1 - k + 2;
        }
        //assert(opt[i] > 0);
        //assert(rp > 0.0);
        ans += rp * opt[i];
    }
    printf("%.10lf\n", ans);
    return 0;
}


#include <bits/stdc++.h>

#define pb push_back
#define f first
#define s second
#define mp make_pair
#define sz(a) int((a).size())
#ifdef _WIN32
#  define I64 "%I64d"
#else
#  define I64 "%lld"
#endif
#define fname "."
#define pi pair < int, int >

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

const int MAX_N = (int)1e6 + 5;
const double eps = 1e-6;
const int inf = (int)1e9 + 123;

using namespace std;

int n, k;
int a[MAX_N], b[MAX_N];

int maxi[20][MAX_N], mini[20][MAX_N], lg[MAX_N];

void init() {
	for (int i = 1; i <= n; i++)
		maxi[0][i] = a[i];
	for (int i = 1; (1 << i) <= n; i++) {
		for (int j = 1; j + (1 << i) - 1 <= n; j++)
			maxi[i][j] = max(maxi[i - 1][j], maxi[i - 1][j + (1 << (i - 1))]);
	}
	for (int i = 1; i <= n; i++)
		mini[0][i] = b[i];
	for (int i = 1; (1 << i) <= n; i++)
		for (int j = 1; j + (1 << i) - 1 <= n; j++)
			mini[i][j] = min(mini[i - 1][j], mini[i - 1][j + (1 << (i - 1))]);
	for (int i = 1, j = 0; i <= n; i++) {
		if ((1 << (j + 1)) == i)
			j++;
		lg[i] = j;
	}
}

inline int get_max(int l, int r) {
	int now = lg[r - l + 1];
	return max(maxi[now][l], maxi[now][r - (1 << now) + 1]);
}

inline int get_min(int l, int r) {
	int now = lg[r - l + 1];
	return min(mini[now][l], mini[now][r - (1 << now) + 1]);
}

inline int get(int l, int r) {
	return min(100 * get_max(l, r), get_min(l, r));
}

inline int Find(int id) {
	int l = id, r = n, m1, m2;
	while(r - l > 3) {
		m1 = l + (r - l) / 3;
		m2 = r - (r - l) / 3;
		if (get(id, m1) <= get(id, m2))
			l = m1;
		else
			r = m2;
	}
	int res = 0;
	for (int i = l; i <= r; i++)
		res = max(res, get(id, i));
	return res;

/*
	int l = id, r = n, mid, ans = id, maxi, mini;
	while(l <= r) {
	  mid = (l + r) / 2;
	  maxi = 100 * get_max(id, mid), mini = get_min(id, mid);
		if (maxi < mini) {
		  ans = mid;
		  l = mid + 1;
		}
		else
			r = mid - 1;
	}
	int res = 0;
	for (int i = ans; i <= min(n, ans + 5); i++)
		res = max(res, min(100 * get_max(id, i), get_min(id, i)));
	return res;*/
}

int val[MAX_N];
ld ans;

int main() {
	#ifdef Nick
	freopen(fname"in","r",stdin);
	freopen(fname"out","w",stdout);
	#endif
	scanf("%d%d", &n, &k);
	for (int i = 1; i <= n; i++)
		scanf("%d", &a[i]);
	for (int i = 1; i <= n; i++)
		scanf("%d", &b[i]);
	init();
	for (int i = 1; i <= n; i++)
		val[i] = Find(i);
	sort(val + 1, val + n + 1);
	double prob = (ld)(k) / (ld)(n);
	for (int i = 1; i <= n; i++) {
	  if (n - i < k - 1)
	  	break;
		ans += prob * val[i];
		prob /= (ld)(n - i);
		prob *= (ld)(n - i - k + 1);
	}
	cout << setprecision(10) << ans << endl;
	return 0;
}


#include <bits/stdc++.h>

#define pb push_back
#define f first
#define s second
#define mp make_pair
#define sz(a) int((a).size())
#ifdef _WIN32
#  define I64 "%I64d"
#else
#  define I64 "%lld"
#endif
#define fname "."
#define pi pair < int, int >

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

const int MAX_N = (int)1e6 + 5;
const double eps = 1e-6;
const int inf = (int)1e9 + 123;

using namespace std;

int n, k;
int a[MAX_N], b[MAX_N];

int maxi[20][MAX_N], mini[20][MAX_N], lg[MAX_N];

void init() {
	for (int i = 1; i <= n; i++)
		maxi[0][i] = a[i];
	for (int i = 1; (1 << i) <= n; i++) {
		for (int j = 1; j + (1 << i) - 1 <= n; j++)
			maxi[i][j] = max(maxi[i - 1][j], maxi[i - 1][j + (1 << (i - 1))]);
	}
	for (int i = 1; i <= n; i++)
		mini[0][i] = b[i];
	for (int i = 1; (1 << i) <= n; i++)
		for (int j = 1; j + (1 << i) - 1 <= n; j++)
			mini[i][j] = min(mini[i - 1][j], mini[i - 1][j + (1 << (i - 1))]);
	for (int i = 1, j = 0; i <= n; i++) {
		if ((1 << (j + 1)) == i)
			j++;
		lg[i] = j;
	}
}

inline int get_max(int l, int r) {
	int now = lg[r - l + 1];
	return max(maxi[now][l], maxi[now][r - (1 << now) + 1]);
}

inline int get_min(int l, int r) {
	int now = lg[r - l + 1];
	return min(mini[now][l], mini[now][r - (1 << now) + 1]);
}

inline int get(int l, int r) {
	return min(100 * get_max(l, r), get_min(l, r));
}

inline int Find(int id) {
	int l = id, r = n, m1, m2;
	while(r - l > 3) {
		m1 = l + (r - l) / 3;
		m2 = r - (r - l) / 3;
		if (get(id, m1) < get(id, m2))
			l = m1;
		else
			r = m2;
	}
	int res = 0;
	for (int i = l; i <= r; i++)
		res = max(res, get(id, i));
	return res;
}

int f[(int)1e7 + 5];

inline void update(int v, int val) {
	for (int i = v; i <= (int)1e7; i |= (i + 1))
		f[i] += val;
}

inline int sum(int v) {
	int res = 0;
	for (int i = v; i >= 0; i = (i & (i + 1)) - 1)
		res += f[i];
	return res;
}

int val[MAX_N], cnt[MAX_N];

ld fact[MAX_N], up, down;

ld C(int n, int k) {
	if (n < k)
		return 0;
	return fact[n] / (fact[k] * fact[n - k]);
}

int main() {
	#ifdef Nick
	freopen(fname"in","r",stdin);
	freopen(fname"out","w",stdout);
	#endif
	scanf("%d%d", &n, &k);
	for (int i = 1; i <= n; i++)
		scanf("%d", &a[i]);
	for (int i = 1; i <= n; i++)
		scanf("%d", &b[i]);
	fact[0] = 1.0;
	for (int i = 1; i <= n; i++)
		fact[i] = (ld)(i) * fact[i - 1];
	init();
	for (int i = 1; i <= n; i++)
		val[i] = Find(i);
	for (int i = 1; i <= n; i++) {
		cnt[i] += ((i - 1) - sum(val[i] - 1));
		update(val[i], 1);
	}

	memset(f, 0, sizeof f);
	for (int i = n; i > 0; i--) {
		cnt[i] += ((n - i) - sum(val[i]));
		update(val[i], 1);
	}
	for (int i = 1; i <= n; i++) {
		up += (ld)(val[i]) * C(cnt[i], k - 1);
	}
	cout << setprecision(10) << up / C(n, k);
	return 0;
}


#include <bits/stdc++.h>

#define pb push_back
#define f first
#define s second
#define mp make_pair
#define sz(a) int((a).size())
#ifdef _WIN32
#  define I64 "%I64d"
#else
#  define I64 "%lld"
#endif
#define fname "."
#define pi pair < int, int >

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

const int MAX_N = (int)1e6 + 5;
const double eps = 1e-6;
const int inf = (int)1e9 + 123;

using namespace std;

int n, k;
int a[MAX_N], b[MAX_N];

int maxi[20][MAX_N], mini[20][MAX_N], lg[MAX_N];

void init() {
	for (int i = 1; i <= n; i++)
		maxi[0][i] = a[i];
	for (int i = 1; (1 << i) <= n; i++) {
		for (int j = 1; j + (1 << i) - 1 <= n; j++)
			maxi[i][j] = max(maxi[i - 1][j], maxi[i - 1][j + (1 << (i - 1))]);
	}
	for (int i = 1; i <= n; i++)
		mini[0][i] = b[i];
	for (int i = 1; (1 << i) <= n; i++)
		for (int j = 1; j + (1 << i) - 1 <= n; j++)
			mini[i][j] = min(mini[i - 1][j], mini[i - 1][j + (1 << (i - 1))]);
	for (int i = 1, j = 0; i <= n; i++) {
		if ((1 << (j + 1)) == i)
			j++;
		lg[i] = j;
	}
}

inline int get_max(int l, int r) {
	int now = lg[r - l + 1];
	return max(maxi[now][l], maxi[now][r - (1 << now) + 1]);
}

inline int get_min(int l, int r) {
	int now = lg[r - l + 1];
	return min(mini[now][l], mini[now][r - (1 << now) + 1]);
}

inline int get(int l, int r) {
	return min(100 * get_max(l, r), get_min(l, r));
}

inline int Find(int id) {
	int l = id, r = n, m1, m2;
	while(r - l > 3) {
		m1 = l + (r - l) / 3;
		m2 = r - (r - l) / 3;
		if (get(id, m1) <= get(id, m2))
			l = m1 + 1;
		else
			r = m2 - 1;
	}
	int res = 0;
	for (int i = l; i <= r; i++)
		res = max(res, get(id, i));
	return res;
}

int f[(int)1e7 + 5];

inline void update(int v, int val) {
	for (int i = v; i <= (int)1e7; i |= (i + 1))
		f[i] += val;
}

inline int sum(int v) {
	int res = 0;
	for (int i = v; i >= 0; i = (i & (i + 1)) - 1)
		res += f[i];
	return res;
}

int val[MAX_N], cnt[MAX_N];

ld fact[MAX_N], up, down;

ld C(int n, int k) {
	if (n < k)
		return 0;
	return fact[n] / (fact[k] * fact[n - k]);
}

int main() {
	#ifdef Nick
	freopen(fname"in","r",stdin);
	freopen(fname"out","w",stdout);
	#endif
	scanf("%d%d", &n, &k);
	for (int i = 1; i <= n; i++)
		scanf("%d", &a[i]);
	for (int i = 1; i <= n; i++)
		scanf("%d", &b[i]);
	fact[0] = 1.0;
	for (int i = 1; i <= n; i++)
		fact[i] = (ld)(i) * fact[i - 1];
	init();
	for (int i = 1; i <= n; i++)
		val[i] = Find(i);
	for (int i = 1; i <= n; i++) {
		cnt[i] += ((i - 1) - sum(val[i] - 1));
		update(val[i], 1);
	}

	memset(f, 0, sizeof f);
	for (int i = n; i > 0; i--) {
		cnt[i] += ((n - i) - sum(val[i]));
		update(val[i], 1);
	}
	for (int i = 1; i <= n; i++) {
		up += (ld)(val[i]) * C(cnt[i], k - 1);
	}
	cout << setprecision(10) << up / C(n, k);
	return 0;
}


#include <bits/stdc++.h>

#define pb push_back
#define f first
#define s second
#define mp make_pair
#define sz(a) int((a).size())
#ifdef _WIN32
#  define I64 "%I64d"
#else
#  define I64 "%lld"
#endif
#define fname "."
#define pi pair < int, int >

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

const int MAX_N = (int)1e6 + 5;
const double eps = 1e-6;
const int inf = (int)1e9 + 123;

using namespace std;

int n, k;
int a[MAX_N], b[MAX_N];

int maxi[20][MAX_N], mini[20][MAX_N], lg[MAX_N];

void init() {
	for (int i = 1; i <= n; i++)
		maxi[0][i] = a[i];
	for (int i = 1; (1 << i) <= n; i++) {
		for (int j = 1; j + (1 << i) - 1 <= n; j++)
			maxi[i][j] = max(maxi[i - 1][j], maxi[i - 1][j + (1 << (i - 1))]);
	}
	for (int i = 1; i <= n; i++)
		mini[0][i] = b[i];
	for (int i = 1; (1 << i) <= n; i++)
		for (int j = 1; j + (1 << i) - 1 <= n; j++)
			mini[i][j] = min(mini[i - 1][j], mini[i - 1][j + (1 << (i - 1))]);
	for (int i = 1, j = 0; i <= n; i++) {
		if ((1 << (j + 1)) == i)
			j++;
		lg[i] = j;
	}
}

inline int get_max(int l, int r) {
	int now = lg[r - l + 1];
	return max(maxi[now][l], maxi[now][r - (1 << now) + 1]);
}

inline int get_min(int l, int r) {
	int now = lg[r - l + 1];
	return min(mini[now][l], mini[now][r - (1 << now) + 1]);
}

inline int Find(int id) {
	int l = id, r = n, mid, ans = id, maxi, mini;
	while(l <= r) {
	  mid = (l + r) / 2;
	  maxi = 100 * get_max(id, mid), mini = get_min(id, mid);
		if (maxi < mini) {
		  ans = mid;
		  l = mid + 1;
		}
		else
			r = mid - 1;
	}
	int res = 0;
	for (int i = ans; i <= min(n, ans + 5); i++)
		res = max(res, min(100 * get_max(id, i), get_min(id, i)));
	return res;
}

int f[(int)1e7 + 5];

inline void update(int v, int val) {
	for (int i = v; i <= (int)1e7; i |= (i + 1))
		f[i] += val;
}

inline int sum(int v) {
	int res = 0;
	for (int i = v; i >= 0; i = (i & (i + 1)) - 1)
		res += f[i];
	return res;
}

int val[MAX_N], cnt[MAX_N];

ld fact[MAX_N], up, down;

ld C(int n, int k) {
	if (n < k)
		return 0;
	return fact[n] / (fact[k] * fact[n - k]);
}

int main() {
	#ifdef Nick
	freopen(fname"in","r",stdin);
	freopen(fname"out","w",stdout);
	#endif
	scanf("%d%d", &n, &k);
	for (int i = 1; i <= n; i++)
		scanf("%d", &a[i]);
	for (int i = 1; i <= n; i++)
		scanf("%d", &b[i]);
	fact[0] = 1.0;
	for (int i = 1; i <= n; i++)
		fact[i] = (ld)(i) * fact[i - 1];
	init();
	for (int i = 1; i <= n; i++)
		val[i] = Find(i);
	for (int i = 1; i <= n; i++) {
		cnt[i] += ((i - 1) - sum(val[i] - 1));
		update(val[i], 1);
	}

	memset(f, 0, sizeof f);
	for (int i = n; i > 0; i--) {
		cnt[i] += ((n - i) - sum(val[i]));
		update(val[i], 1);
	}
	for (int i = 1; i <= n; i++) {
		up += (ld)(val[i]) * C(cnt[i], k - 1);
	}
	cout << setprecision(10) << up / C(n, k);
	return 0;
}


#include <bits/stdc++.h>

#define pb push_back
#define f first
#define s second
#define mp make_pair
#define sz(a) int((a).size())
#ifdef _WIN32
#  define I64 "%I64d"
#else
#  define I64 "%lld"
#endif
#define fname "."
#define pi pair < int, int >

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

const int MAX_N = (int)1e6 + 5;
const double eps = 1e-6;
const int inf = (int)1e9 + 123;

using namespace std;

int n, k;
int a[MAX_N], b[MAX_N];

int maxi[20][MAX_N], mini[20][MAX_N], lg[MAX_N];

void init() {
	for (int i = 1; i <= n; i++)
		maxi[0][i] = a[i];
	for (int i = 1; (1 << i) <= n; i++) {
		for (int j = 1; j + (1 << i) - 1 <= n; j++)
			maxi[i][j] = max(maxi[i - 1][j], maxi[i - 1][j + (1 << (i - 1))]);
	}
	for (int i = 1; i <= n; i++)
		mini[0][i] = b[i];
	for (int i = 1; (1 << i) <= n; i++)
		for (int j = 1; j + (1 << i) - 1 <= n; j++)
			mini[i][j] = min(mini[i - 1][j], mini[i - 1][j + (1 << (i - 1))]);
	for (int i = 1, j = 0; i <= n; i++) {
		if ((1 << (j + 1)) == i)
			j++;
		lg[i] = j;
	}
}

inline int get_max(int l, int r) {
	int now = lg[r - l + 1];
	return max(maxi[now][l], maxi[now][r - (1 << now) + 1]);
}

inline int get_min(int l, int r) {
	int now = lg[r - l + 1];
	return min(mini[now][l], mini[now][r - (1 << now) + 1]);
}

inline int get(int l, int r) {
	return min(100 * get_max(l, r), get_min(l, r));
}

inline int Find(int id) {
	int l = id, r = n, m1, m2;
	while(r - l > 3) {
		m1 = l + (r - l) / 3;
		m2 = r - (r - l) / 3;
		if (get(id, m1) <= get(id, m2))
			l = m1;
		else
			r = m2;
	}
	int res = 0;
	for (int i = l; i <= r; i++)
		res = max(res, get(id, i));
	return res;
}

int f[(int)1e7 + 5];

inline void update(int v, int val) {
	for (int i = v; i <= (int)1e7; i |= (i + 1))
		f[i] += val;
}

inline int sum(int v) {
	int res = 0;
	for (int i = v; i >= 0; i = (i & (i + 1)) - 1)
		res += f[i];
	return res;
}

int val[MAX_N], cnt[MAX_N];

ld fact[MAX_N], up, down;

ld C(int n, int k) {
	if (n < k)
		return 0;
	return fact[n] / (fact[k] * fact[n - k]);
}

int main() {
	#ifdef Nick
	freopen(fname"in","r",stdin);
	freopen(fname"out","w",stdout);
	#endif
	scanf("%d%d", &n, &k);
	for (int i = 1; i <= n; i++)
		scanf("%d", &a[i]);
	for (int i = 1; i <= n; i++)
		scanf("%d", &b[i]);
	fact[0] = 1.0;
	for (int i = 1; i <= n; i++)
		fact[i] = (ld)(i) * fact[i - 1];
	init();
	for (int i = 1; i <= n; i++)
		val[i] = Find(i);
	for (int i = 1; i <= n; i++) {
		cnt[i] += ((i - 1) - sum(val[i] - 1));
		update(val[i], 1);
	}

	memset(f, 0, sizeof f);
	for (int i = n; i > 0; i--) {
		cnt[i] += ((n - i) - sum(val[i]));
		update(val[i], 1);
	}
	for (int i = 1; i <= n; i++) {
		up += (ld)(val[i]) * C(cnt[i], k - 1);
	}
	cout << setprecision(10) << up / C(n, k);
	return 0;
}


#include <bits/stdc++.h>

#define pb push_back
#define f first
#define s second
#define mp make_pair
#define sz(a) int((a).size())
#ifdef _WIN32
#  define I64 "%I64d"
#else
#  define I64 "%lld"
#endif
#define fname "."
#define pi pair < int, int >

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

const int MAX_N = (int)1e6 + 5;
const double eps = 1e-6;
const int inf = (int)1e9 + 123;

using namespace std;

int n, k;
int a[MAX_N], b[MAX_N];

int maxi[20][MAX_N], mini[20][MAX_N], lg[MAX_N];

void init() {
	for (int i = 1; i <= n; i++)
		maxi[0][i] = a[i];
	for (int i = 1; (1 << i) <= n; i++) {
		for (int j = 1; j + (1 << i) - 1 <= n; j++)
			maxi[i][j] = max(maxi[i - 1][j], maxi[i - 1][j + (1 << (i - 1))]);
	}
	for (int i = 1; i <= n; i++)
		mini[0][i] = b[i];
	for (int i = 1; (1 << i) <= n; i++)
		for (int j = 1; j + (1 << i) - 1 <= n; j++)
			mini[i][j] = min(mini[i - 1][j], mini[i - 1][j + (1 << (i - 1))]);
	for (int i = 1, j = 0; i <= n; i++) {
		if ((1 << (j + 1)) == i)
			j++;
		lg[i] = j;
	}
}

inline int get_max(int l, int r) {
	int now = lg[r - l + 1];
	return max(maxi[now][l], maxi[now][r - (1 << now) + 1]);
}

inline int get_min(int l, int r) {
	int now = lg[r - l + 1];
	return min(mini[now][l], mini[now][r - (1 << now) + 1]);
}

inline int get(int l, int r) {
	return min(100 * get_max(l, r), get_min(l, r));
}

inline int Find(int id) {
/*	int l = id, r = n, m1, m2;
	while(r - l > 3) {
		m1 = l + (r - l) / 3;
		m2 = r - (r - l) / 3;
		if (get(id, m1) < get(id, m2))
			l = m1;
		else
			r = m2;
	}
	int res = 0;
	for (int i = l; i <= r; i++)
		res = max(res, get(id, i));
	return res;*/

	int l = id, r = n, mid, ans = id, maxi, mini;
	while(l <= r) {
	  mid = (l + r) / 2;
	  maxi = 100 * get_max(id, mid), mini = get_min(id, mid);
		if (maxi <= mini) {
		  ans = mid;
		  l = mid + 1;
		}
		else
			r = mid - 1;
	}
	int res = 0;
	for (int i = ans; i <= min(n, ans + 5); i++)
		res = max(res, min(100 * get_max(id, i), get_min(id, i)));
	return res;
}

int val[MAX_N];
ld ans;

int main() {
	#ifdef Nick
	freopen(fname"in","r",stdin);
	freopen(fname"out","w",stdout);
	#endif
	scanf("%d%d", &n, &k);
	for (int i = 1; i <= n; i++)
		scanf("%d", &a[i]);
	for (int i = 1; i <= n; i++)
		scanf("%d", &b[i]);
	init();
	for (int i = 1; i <= n; i++)
		val[i] = Find(i);
	sort(val + 1, val + n + 1);
	double prob = (ld)(k) / (ld)(n);
	for (int i = 1; i <= n; i++) {
	  if (n - i < k - 1)
	  	break;
		ans += prob * val[i];
		prob /= (ld)(n - i);
		prob *= (ld)(n - i - k + 1);
	}
	cout << setprecision(10) << ans << endl;
	return 0;
}


#include <bits/stdc++.h>

#define pb push_back
#define f first
#define s second
#define mp make_pair
#define sz(a) int((a).size())
#ifdef _WIN32
#  define I64 "%I64d"
#else
#  define I64 "%lld"
#endif
#define fname "."
#define pi pair < int, int >

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

const int MAX_N = (int)1e6 + 5;
const double eps = 1e-6;
const int inf = (int)1e9 + 123;

using namespace std;

int n, k;
int a[MAX_N], b[MAX_N];

int maxi[20][MAX_N], mini[20][MAX_N], lg[MAX_N];

void init() {
	for (int i = 1; i <= n; i++)
		maxi[0][i] = a[i];
	for (int i = 1; (1 << i) <= n; i++) {
		for (int j = 1; j + (1 << i) - 1 <= n; j++)
			maxi[i][j] = max(maxi[i - 1][j], maxi[i - 1][j + (1 << (i - 1))]);
	}
	for (int i = 1; i <= n; i++)
		mini[0][i] = b[i];
	for (int i = 1; (1 << i) <= n; i++)
		for (int j = 1; j + (1 << i) - 1 <= n; j++)
			mini[i][j] = min(mini[i - 1][j], mini[i - 1][j + (1 << (i - 1))]);
	for (int i = 1, j = 0; i <= n; i++) {
		if ((1 << (j + 1)) == i)
			j++;
		lg[i] = j;
	}
}

inline int get_max(int l, int r) {
	int now = lg[r - l + 1];
	return max(maxi[now][l], maxi[now][r - (1 << now) + 1]);
}

inline int get_min(int l, int r) {
	int now = lg[r - l + 1];
	return min(mini[now][l], mini[now][r - (1 << now) + 1]);
}

inline int Find(int id) {
	int l = id, r = n, mid, ans = id, maxi, mini;
	while(l <= r) {
	  mid = (l + r) / 2;
	  maxi = 100 * get_max(id, mid), mini = get_min(id, mid);
		if (maxi <= mini) {
		  ans = mid;
		  l = mid + 1;
		}
		else
			r = mid - 1;
	}
	return min(100 * get_max(id, ans), get_min(id, ans));
}

int f[(int)1e7 + 5];

inline void update(int v, int val) {
	for (int i = v; i <= (int)1e7; i |= (i + 1))
		f[i] += val;
}

inline int sum(int v) {
	int res = 0;
	for (int i = v; i >= 0; i = (i & (i + 1)) - 1)
		res += f[i];
	return res;
}

int val[MAX_N], cnt[MAX_N];

ld fact[MAX_N], up, down;

ld C(int n, int k) {
	if (n < k)
		return 0;
	return fact[n] / (fact[k] * fact[n - k]);
}

int main() {
	#ifdef Nick
	freopen(fname"in","r",stdin);
	freopen(fname"out","w",stdout);
	#endif
	scanf("%d%d", &n, &k);
	for (int i = 1; i <= n; i++)
		scanf("%d", &a[i]);
	for (int i = 1; i <= n; i++)
		scanf("%d", &b[i]);
	fact[0] = 1.0;
	for (int i = 1; i <= n; i++)
		fact[i] = (ld)(i) * fact[i - 1];
	init();
	for (int i = 1; i <= n; i++)
		val[i] = Find(i);
	for (int i = 1; i <= n; i++) {
		cnt[i] += ((i - 1) - sum(val[i] - 1));
		update(val[i], 1);
	}

	memset(f, 0, sizeof f);
	for (int i = n; i > 0; i--) {
		cnt[i] += ((n - i) - sum(val[i]));
		update(val[i], 1);
	}
	for (int i = 1; i <= n; i++) {
		up += (ld)(val[i]) * C(cnt[i], k - 1);
	}
	cout << setprecision(10) << up / C(n, k);
	return 0;
}


#include <bits/stdc++.h>

#define pb push_back
#define f first
#define s second
#define mp make_pair
#define sz(a) int((a).size())
#ifdef _WIN32
#  define I64 "%I64d"
#else
#  define I64 "%lld"
#endif
#define fname "."
#define pi pair < int, int >

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

const int MAX_N = (int)1e6 + 5;
const double eps = 1e-6;
const int inf = (int)1e9 + 123;

using namespace std;

int n, k;
int a[MAX_N], b[MAX_N];

int maxi[20][MAX_N], mini[20][MAX_N], lg[MAX_N];

void init() {
	for (int i = 1; i <= n; i++)
		maxi[0][i] = a[i];
	for (int i = 1; (1 << i) <= n; i++) {
		for (int j = 1; j + (1 << i) - 1 <= n; j++)
			maxi[i][j] = max(maxi[i - 1][j], maxi[i - 1][j + (1 << (i - 1))]);
	}
	for (int i = 1; i <= n; i++)
		mini[0][i] = b[i];
	for (int i = 1; (1 << i) <= n; i++)
		for (int j = 1; j + (1 << i) - 1 <= n; j++)
			mini[i][j] = min(mini[i - 1][j], mini[i - 1][j + (1 << (i - 1))]);
	for (int i = 1, j = 0; i <= n; i++) {
		if ((1 << (j + 1)) == i)
			j++;
		lg[i] = j;
	}
}

inline int get_max(int l, int r) {
	int now = lg[r - l + 1];
	return max(maxi[now][l], maxi[now][r - (1 << now) + 1]);
}

inline int get_min(int l, int r) {
	int now = lg[r - l + 1];
	return min(mini[now][l], mini[now][r - (1 << now) + 1]);
}

inline int get(int l, int r) {
	return min(100 * get_max(l, r), get_min(l, r));
}

inline int Find(int id) {
/*	int l = id, r = n, m1, m2;
	while(r - l > 3) {
		m1 = l + (r - l) / 3;
		m2 = r - (r - l) / 3;
		if (get(id, m1) < get(id, m2))
			l = m1;
		else
			r = m2;
	}
	int res = 0;
	for (int i = l; i <= r; i++)
		res = max(res, get(id, i));
	return res;*/

	int l = id, r = n, mid, maxi, mini, L = -1, R = -1;
	while(l <= r) {
	  mid = (l + r) / 2;
	  maxi = 100 * get_max(id, mid), mini = get_min(id, mid);
		if (maxi < mini) {
		  L = mid;
		  l = mid + 1;
		}
		else if (maxi == mini)
			return maxi;
		else {
			R = mid;
			r = mid - 1;
		}
	}
	int res = 0;
	if (L != -1)
		res = max(res, min(100 * get_max(id, L), get_min(id, L)));
	if (R != -1)
		res = max(res, min(100 * get_max(id, R), get_min(id, R)));
	return res;
}

int val[MAX_N];
ld ans;

int main() {
	#ifdef Nick
	freopen(fname"in","r",stdin);
	freopen(fname"out","w",stdout);
	#endif
	scanf("%d%d", &n, &k);
	for (int i = 1; i <= n; i++)
		scanf("%d", &a[i]);
	for (int i = 1; i <= n; i++)
		scanf("%d", &b[i]);
	init();
	for (int i = 1; i <= n; i++)
		val[i] = Find(i);
	sort(val + 1, val + n + 1);
	double prob = (ld)(k) / (ld)(n);
	for (int i = 1; i <= n; i++) {
	  if (n - i < k - 1)
	  	break;
		ans += prob * val[i];
		prob /= (ld)(n - i);
		prob *= (ld)(n - i - k + 1);
	}
	cout << setprecision(10) << ans << endl;
	return 0;
}


import math
test=int(input())
for _ in range(test):
    h,c,t=map(int,input().split())
    if t<=(h+c)/2:
        print(2)
    else:
        k=math.floor((h-t)/(2*t-h-c))
        k1=k+1
        if ((k*(h+c)+h)/(2*k+1))-t <= t-((k1*(h+c)+h)/(2*k1+1)):
            print(2*(k+1)-1)
        else:
            print(2*(k1+1)-1)


import math
def binary_search(l,r,x,y,req):
    mid=math.floor((l+r)/2)
    ans=(mid*x+(mid-1)*y)/(2*mid-1)
    ans1=((mid+1)*x+(mid)*y)/(2*(mid+1)-1)
    ans2=((mid-1)*x+(mid-2)*y)/(2*(mid-1)-1)
    if ans>=req:
        if ans1<req:
            return mid
        else:
            return binary_search(mid+1,r,x,y,req)
    elif ans<req:
        if ans2>req:
            return mid-1
        else:
            return binary_search(l,mid,x,y,req)

test=int(input())
for _ in range(test):
    x,y,req=map(int,input().split())
    if req==(x+y)/2:
        print(2)
    elif req<(x+y)/2:
        print(2)
    else:
        out=binary_search(1,100000000,x,y,req)
        out1=out+1
        if ((out*x)+((out-1)*y))/(2*out-1)-req <= req-((out1*x)+((out1-1)*y))/(2*out1-1):
            print(2*out-1)
        else:
            print(2*out1-1)


import math
def binary_search(l,r,x,y,req):
    mid=math.floor((l+r)/2)
    ans=(mid*x+(mid-1)*y)/(2*mid-1)
    ans1=((mid+1)*x+(mid)*y)/(2*(mid+1)-1)
    ans2=((mid-1)*x+(mid-2)*y)/(2*(mid-1)-1)
    if ans>=req:
        if ans1<req:
            return mid
        else:
            return binary_search(mid+1,r,x,y,req)
    elif ans<req:
        if ans2>req:
            return mid-1
        else:
            return binary_search(l,mid,x,y,req)

test=int(input())
for _ in range(test):
    x,y,req=map(int,input().split())
    if req==(x+y)/2:
        print(2)
    elif req<(x+y)/2:
        print(2)
    else:
        out=binary_search(1,90000000,x,y,req)
        out1=out+1
        if ((out*x)+((out-1)*y))/(2*out-1)-req <= req-((out1*x)+((out1-1)*y))/(2*out1-1):
            print(2*out-1)
        else:
            print(2*out1-1)


import math
test=int(input())
for _ in range(test):
    h,c,t=map(int,input().split())
    if t<=(h+c)/2:
        print(2)
    else:
        k=math.floor((h-t)/(2*t-h-c))
        k1=k+1
        if ((k*(h+c)+h)/(2*k+1))-t < t-((k1*(h+c)+h)/(2*k1+1)):
            print(2*(k+1)-1)
        else:
            print(2*(k1+1)-1)


from decimal import *
getcontext().prec = 14

def solve():
    if h == c:
        return 1
    if (h + c) // 2 >= t:
        print(2)
        return
    ans = bs(1, 10 ** 6)
    a1 = getdif(ans)
    a2 = getdif(ans - 1)
    if abs(t - a1) < abs(t - a2):
        print(2 * ans - 1)
    else:
        ans -= 1
        print(2 * ans - 1)
    return

def bs(l, r):
    while l < r:
        m = (l + r) // 2
        if check(m):
            r = m
        else:
            l = m + 1
    return r

def check(hh):
    temp = getdif(hh)
    # print(hh, ": ", temp)
    if temp < t:
        return 1
    else:
        return 0

def getdif(hh):
    return Decimal(hh * h + (hh-1) * c) / Decimal(2*hh-1)

# def solve2():
#     hc = [0, 0]
#     mt = 10**9
#     ans = [0, 0]
#     for i in range(10**6):
#         hc[i&1] += 1
#         temp = abs(t- (hc[0] * h + hc[1]*c) / float(hc[0] + hc[1]))
#         if temp < mt:
#             mt = temp
#             ans = list(hc)
#     print(sum(ans))
#     return

T = int(input())
for _ in range(T):
    h, c, t = [int(i) for i in input().split()]
    solve()


from decimal import *
getcontext().prec = 28

def solve():
    if h == c:
        return 1
    if (h + c) // 2 >= t:
        print(2)
        return
    ans = bs(1, 10 ** 6)
    a1 = getdif(ans)
    a2 = getdif(ans - 1)
    if abs(t - a1) < abs(t - a2):
        print(2 * ans - 1)
    else:
        ans -= 1
        print(2 * ans - 1)
    return

def bs(l, r):
    while l < r:
        m = (l + r) // 2
        if check(m):
            r = m
        else:
            l = m + 1
    return r

def check(hh):
    temp = getdif(hh)
    # print(hh, ": ", temp)
    if temp < t:
        return 1
    else:
        return 0

def getdif(hh):
    return Decimal(hh * h + (hh-1) * c) / Decimal(2*hh-1)

# def solve2():
#     hc = [0, 0]
#     mt = 10**9
#     ans = [0, 0]
#     for i in range(10**6):
#         hc[i&1] += 1
#         temp = abs(t- (hc[0] * h + hc[1]*c) / float(hc[0] + hc[1]))
#         if temp < mt:
#             mt = temp
#             ans = list(hc)
#     print(sum(ans))
#     return

T = int(input())
for _ in range(T):
    h, c, t = [int(i) for i in input().split()]
    solve()


test=int(input())

while test:
    h,c,t=map(int,input().split())

    choto=abs((h+c)-t)
    if (h+c-2*t)*(t-c)>=0:
        print(2)
    else:
        x=1
        ch=abs(x*(h+c-2*t)+t-c)/(2*x-1)
        x=2
        while True:
            ch1=abs(x*(h+c-2*t)+t-c)/(2*x-1)
            #print(ch1)
            if ch1>=ch:
                break
            ch=ch1
            x+=1

        x-=1
        print(2*x-1)

    test-=1


test=int(input())

while test:
    h,c,t=map(int,input().split())

    choto=abs((h+c)-t)
    if (h+c-2*t)*(t-c)>=0:
        print(2)
    else:
        x=1
        ch=abs(x*(h+c-2*t)+t-c)/(2*x-1)
        x=2
        while True:
            ch1=abs(x*(h+c-2*t)+t-c)/(2*x-1)
            #print(ch1)
            if ch1>ch:
                break
            ch=ch1
            x+=1

        x-=1
        print(2*x-1)

    test-=1


import math
t=int(input())
for _ in range(t):
    h,c,k=map(int,input().split())
    p=0
    a=0
    w=1
    D=0
    y,z=k,0
    while(w):
        a+=1
        if a%2!=0:
            p+=h
        else:
            p+=c
        D=p/a
        z=abs(k-D)
        if math.ceil(D)==k or math.floor(D)==k:
            w=0
    print(a)


def temp(h, c, n):
    return h * (n + 1) + c * n, 2 * n + 1

for _ in range(int(input())):
    h, c, t = map(int, input().split())
    if t * 2 <= (h + c):
        print(2)
        continue
    n = (h - t) // (2 * t - h - c)
    n1 = n + 1
    a, b = temp(h, c, n)
    a1, b1 = temp(h, c, n1)
    d, dn = abs(a - b * t), b
    d1, dn1 = abs(a1 - b1 * t), b1
    if d * dn1 > d1 * dn:
        ans = n1
    else:
        ans = n
    print(2 * ans + 1)


import math
t=int(input())
for _ in range(t):
    h,c,k=map(int,input().split())
    p=0
    a=0
    w=1
    D=0
    y,z=k,0
    while(w):
        a+=1
        if a%2!=0:
            p+=h
        else:
            p+=c
        D=p/a
        z=abs(k-D)
        if math.ceil(D)==k:
            w=0
    print(a)


import sys
# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')

import math
import collections
from sys import stdin,stdout,setrecursionlimit
import bisect as bs
setrecursionlimit(2**20)
M = 10**9+7

T = int(stdin.readline())
# T = 1

def ceil(x,y):
    return x//y + (1 if x%y != 0 else 0)

def fun(x,h,c,t):
    return abs((x*c + (x+1)*h)/(2*x+1)-t)

for _ in range(T):
    # n = int(stdin.readline())
    h,c,t = list(map(int,stdin.readline().split()))
    # d = list(map(int,stdin.readline().split()))
    # q = list(map(int,stdin.readline().split()))
    # b = list(map(int,stdin.readline().split()))
    # s = stdin.readline().strip('\n')

    if(h == t):
        print(1)
        continue

    if(t <= (h+c)/2):
        print(2)
        continue

    a = []
    x = ceil(h-t, 2*t-c-h)
    y = (h-t)//(2*t-c-h)

    num1 = y*c + (y+1)*h - (2*y+1)*t
    den1 = 2*y + 1
    num2 = (2*x+1)*t - x*c - (x+1)*h
    den2 = (2*x + 1)

    if(num1*den2 - num2*den2 > 0):
        print(2*y+1)
    else:
        print(2*x+1)
    # a.append([abs(((c+h)/2)-t),2])
    # a.append([fun(x,h,c,t), 2*x+1])
    # a.append([fun(y,h,c,t), 2*y+1])
    # ans = a[0][1]
    # mn = a[0][0]
    # print(a)
    # for diff, num in a[1:]:
    #     # print(diff,num,ans)
    #     if(diff < mn):
    #         mn = diff
    #         ans = num
    #     if(diff == mn):
    #         # print('*')
    #         if(ans >= num):
    #             ans = num
    #     # print(mn,ans)

    # print(int(ans))


import sys
# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')

import math
import collections
from sys import stdin,stdout,setrecursionlimit
import bisect as bs
setrecursionlimit(2**20)
M = 10**9+7

T = int(stdin.readline())
# T = 1

def ceil(x,y):
    return x//y + (1 if x%y != 0 else 0)

def fun(x,h,c,t):
    return abs((x*c + (x+1)*h)/(2*x+1)-t)

for _ in range(T):
    # n = int(stdin.readline())
    h,c,t = list(map(int,stdin.readline().split()))
    # d = list(map(int,stdin.readline().split()))
    # q = list(map(int,stdin.readline().split()))
    # b = list(map(int,stdin.readline().split()))
    # s = stdin.readline().strip('\n')

    if(h == t):
        print(1)
        continue

    if(t <= (h+c)/2):
        print(2)
        continue

    a = []
    x = ceil(t-h, c+h-2*t)
    y = (h-t)//(2*t-c-h)
    a.append([abs(((c+h)/2)-t),2])
    a.append([fun(x,h,c,t), 2*x+1])
    a.append([fun(y,h,c,t), 2*y+1])
    ans = a[0][1]
    mn = a[0][0]

    for diff, num in a[1:]:
        # print(diff,num,ans)
        if(diff < mn):
            mn = diff
            ans = num
        if(diff == mn):
            # print('*')
            if(ans >= num):
                ans = num
        # print(mn,ans)

    print(int(ans))


import sys
# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')

import math
import collections
from sys import stdin,stdout,setrecursionlimit
import bisect as bs
setrecursionlimit(2**20)
M = 10**9+7

T = int(stdin.readline())
# T = 1

def ceil(x,y):
    return x//y + (1 if x%y != 1 else 0)

def fun(x,h,c,t):
    return abs((x*c + (x+1)*h)/(2*x+1)-t)

for _ in range(T):
    # n = int(stdin.readline())
    h,c,t = list(map(int,stdin.readline().split()))
    # d = list(map(int,stdin.readline().split()))
    # q = list(map(int,stdin.readline().split()))
    # b = list(map(int,stdin.readline().split()))
    # s = stdin.readline().strip('\n')

    if(h == t):
        print(1)
        continue

    if((h+c)//2 == t):
        print(2)
        continue

    if(t > (h+c)/2):
        a = []
        x = ceil(t-h, c+h-2*t)
        y = (t-h)//(c+h-2*t)
        a.append([abs(((c+h)//2)-t),2])
        if(x < 0):
            a.append([fun(x,h,c,t), 2*x+1])
        a.append([fun(y,h,c,t), 2*y+1])
        ans = a[0][1]
        mn = a[0][0]
        for diff, num in a[1:]:
            if(diff < mn):
                mn = diff
                ans = num
            if(diff == num):
                if(ans >= num):
                    ans = num
    else:
        print(2)
    print(ans)


import sys
# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')

import math
import collections
from sys import stdin,stdout,setrecursionlimit
import bisect as bs
setrecursionlimit(2**20)
M = 10**9+7

T = int(stdin.readline())
# T = 1

def ceil(x,y):
    return x//y + (1 if x%y != 0 else 0)

def fun(x,h,c,t):
    return abs((x*c + (x+1)*h)/(2*x+1)-t)

for _ in range(T):
    # n = int(stdin.readline())
    h,c,t = list(map(int,stdin.readline().split()))
    # d = list(map(int,stdin.readline().split()))
    # q = list(map(int,stdin.readline().split()))
    # b = list(map(int,stdin.readline().split()))
    # s = stdin.readline().strip('\n')

    if(h == t):
        print(1)
        continue

    if(t <= (h+c)/2):
        print(2)
        continue

    a = []
    x = ceil(h-t, 2*t-c-h)
    y = (h-t)//(2*t-c-h)

    num1 = y*c + (y+1)*h - (2*y+1)*t
    den1 = 2*y + 1
    num2 = (2*x+1)*t - x*c - (x+1)*h
    den2 = (2*x + 1)
    # print(x,y)
    # print(num1,den1,num2,den2)
    if(num1*den2 - num2*den1 > 0):
        print(int(2*x+1))
    else:
        print(int(2*y+1))
    # a.append([abs(((c+h)/2)-t),2])
    # a.append([fun(x,h,c,t), 2*x+1])
    # a.append([fun(y,h,c,t), 2*y+1])
    # ans = a[0][1]
    # mn = a[0][0]
    # print(a)
    # for diff, num in a[1:]:
    #     # print(diff,num,ans)
    #     if(diff < mn):
    #         mn = diff
    #         ans = num
    #     if(diff == mn):
    #         # print('*')
    #         if(ans >= num):
    #             ans = num
    #     # print(mn,ans)

    # print(int(ans))


import sys
#sys.stdin = open('input.txt', 'r')
#sys.stdout = open('output.txt', 'w')

import math
import collections
from sys import stdin,stdout,setrecursionlimit
import bisect as bs
setrecursionlimit(2**20)
M = 10**9+7

T = int(stdin.readline())
# T = 1

def ceil(x,y):
    return x//y + (1 if x%y != 0 else 0)

def fun(x,h,c,t):
    return abs((x*c + (x+1)*h)/(2*x+1)-t)

for _ in range(T):
    # n = int(stdin.readline())
    h,c,t = list(map(int,stdin.readline().split()))
    # d = list(map(int,stdin.readline().split()))
    # q = list(map(int,stdin.readline().split()))
    # b = list(map(int,stdin.readline().split()))
    # s = stdin.readline().strip('\n')

    if(h == t):
        print(1)
        continue

    if(t <= (h+c)/2):
        print(2)
        continue

    if(t > (h+c)/2):
        a = []
        x = ceil(t-h, c+h-2*t)
        y = (t-h)//(c+h-2*t)
        a.append([abs(((c+h)/2)-t),2])
        a.append([fun(x,h,c,t), 2*x+1])
        a.append([fun(y,h,c,t), 2*y+1])
        ans = a[0][1]
        mn = a[0][0]
        # print(a)
        for diff, num in a[1:]:
            # print(diff,num,ans)
            if(diff < mn):
                mn = diff
                ans = num
            if(diff == mn):
                # print('*')
                if(ans >= num):
                    ans = num
            # print(mn,ans)

    print(int(ans))


import sys
# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')

import math
import collections
from sys import stdin,stdout,setrecursionlimit
import bisect as bs
setrecursionlimit(2**20)
M = 10**9+7

T = int(stdin.readline())
# T = 1

def ceil(x,y):
    return x//y + (1 if x%y != 0 else 0)

def fun(x,h,c,t):
    return abs((x*c + (x+1)*h)/(2*x+1)-t)

for _ in range(T):
    # n = int(stdin.readline())
    h,c,t = list(map(int,stdin.readline().split()))
    # d = list(map(int,stdin.readline().split()))
    # q = list(map(int,stdin.readline().split()))
    # b = list(map(int,stdin.readline().split()))
    # s = stdin.readline().strip('\n')

    if(h == t):
        print(1)
        continue

    if(t <= (h+c)/2):
        print(2)
        continue

    a = []
    x = ceil(h-t, 2*t-c-h)
    y = (h-t)//(2*t-c-h)
    a.append([abs(((c+h)/2)-t),2])
    a.append([fun(x,h,c,t), 2*x+1])
    a.append([fun(y,h,c,t), 2*y+1])
    ans = a[0][1]
    mn = a[0][0]

    for diff, num in a[1:]:
        # print(diff,num,ans)
        if(diff < mn):
            mn = diff
            ans = num
        if(diff == mn):
            # print('*')
            if(ans >= num):
                ans = num
        # print(mn,ans)

    print(int(ans))


import sys
# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')

import math
import collections
from sys import stdin,stdout,setrecursionlimit
import bisect as bs
setrecursionlimit(2**20)
M = 10**9+7

T = int(stdin.readline())
# T = 1

def ceil(x,y):
    return x//y + (1 if x%y != 1 else 0)

def fun(x,h,c,t):
    return abs((x*c + (x+1)*h)/(2*x+1)-t)

for _ in range(T):
    # n = int(stdin.readline())
    h,c,t = list(map(int,stdin.readline().split()))
    # d = list(map(int,stdin.readline().split()))
    # q = list(map(int,stdin.readline().split()))
    # b = list(map(int,stdin.readline().split()))
    # s = stdin.readline().strip('\n')

    if(h == t):
        print(1)
        continue

    if(t <= (h+c)/2):
        print(2)
        continue

    if(t > (h+c)/2):
        a = []
        x = ceil(t-h, c+h-2*t)
        y = (t-h)//(c+h-2*t)
        a.append([abs(((c+h)/2)-t),2])
        a.append([fun(x,h,c,t), 2*x+1])
        a.append([fun(y,h,c,t), 2*y+1])
        ans = a[0][1]
        mn = a[0][0]
        for diff, num in a[1:]:
            if(diff < mn):
                mn = diff
                ans = num
            if(diff == num):
                if(ans >= num):
                    ans = num

    print(ans)


import sys
#sys.stdin = open('input.txt', 'r')
#sys.stdout = open('output.txt', 'w')

import math
import collections
from sys import stdin,stdout,setrecursionlimit
import bisect as bs
setrecursionlimit(2**20)
M = 10**9+7

T = int(stdin.readline())
# T = 1

def ceil(x,y):
    return x//y + (1 if x%y != 0 else 0)

def fun(x,h,c,t):
    return abs((x*c + (x+1)*h)/(2*x+1)-t)

for _ in range(T):
    # n = int(stdin.readline())
    h,c,t = list(map(int,stdin.readline().split()))
    # d = list(map(int,stdin.readline().split()))
    # q = list(map(int,stdin.readline().split()))
    # b = list(map(int,stdin.readline().split()))
    # s = stdin.readline().strip('\n')

    if(h == t):
        print(1)
        continue

    if(t <= (h+c)/2):
        print(2)
        continue

    if(t > (h+c)/2):
        a = []
        x = ceil(t-h, c+h-2*t)
        y = (t-h)//(c+h-2*t)
        a.append([abs(((c+h)/2)-t),2])
        a.append([fun(x,h,c,t), 2*x+1])
        a.append([fun(y,h,c,t), 2*y+1])
        ans = a[0][1]
        mn = a[0][0]
        #print(a)
        for diff, num in a[1:]:
            #print(diff,num,ans)
            if(diff < mn):
                mn = diff
                ans = num
            if(diff == mn):
                #print('*')
                if(ans >= num):
                    ans = num
            #print(mn,ans)

    print(ans)


import sys
# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')

import math
import collections
from sys import stdin,stdout,setrecursionlimit
import bisect as bs
setrecursionlimit(2**20)
M = 10**9+7

T = int(stdin.readline())
# T = 1

def ceil(x,y):
    return x//y + (1 if x%y != 1 else 0)

def fun(x,h,c,t):
    return abs((x*c + (x+1)*h)/(2*x+1)-t)

for _ in range(T):
    # n = int(stdin.readline())
    h,c,t = list(map(int,stdin.readline().split()))
    # d = list(map(int,stdin.readline().split()))
    # q = list(map(int,stdin.readline().split()))
    # b = list(map(int,stdin.readline().split()))
    # s = stdin.readline().strip('\n')

    if(h == t):
        print(1)
        continue

    if(t <= (h+c)/2):
        print(2)
        continue

    if(t > (h+c)/2):
        a = []
        x = ceil(t-h, c+h-2*t)
        y = (t-h)//(c+h-2*t)
        a.append([abs(((c+h)/2)-t),2])
        a.append([fun(x,h,c,t), 2*x+1])
        a.append([fun(y,h,c,t), 2*y+1])
        ans = a[0][1]
        mn = a[0][0]
        # print(a)
        for diff, num in a[1:]:
            # print(diff,num,ans)
            if(diff < mn):
                mn = diff
                ans = num
            if(diff == mn):
                if(ans >= num):
                    ans = num
            # print(mn,ans)

    print(ans)


import sys
# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')

import math
import collections
from sys import stdin,stdout,setrecursionlimit
import bisect as bs
setrecursionlimit(2**20)
M = 10**9+7

T = int(stdin.readline())
# T = 1

def ceil(x,y):
    return x//y + (1 if x%y != 1 else 0)

def fun(x,h,c,t):
    return abs((x*c + (x+1)*h)/(2*x+1)-t)

for _ in range(T):
    # n = int(stdin.readline())
    h,c,t = list(map(int,stdin.readline().split()))
    # d = list(map(int,stdin.readline().split()))
    # q = list(map(int,stdin.readline().split()))
    # b = list(map(int,stdin.readline().split()))
    # s = stdin.readline().strip('\n')

    if(h == t):
        print(1)
        continue

    if((h+c)//2 == t):
        print(2)
        continue

    if(t > (h+c)/2):
        a = []
        x = ceil(t-h, c+h-2*t)
        y = (t-h)//(c+h-2*t)
        a.append([abs(((c+h)//2)-t),2])
        a.append([fun(x,h,c,t), 2*x+1])
        a.append([fun(y,h,c,t), 2*y+1])
        ans = a[0][1]
        mn = a[0][0]
        for diff, num in a[1:]:
            if(diff < mn):
                mn = diff
                ans = num
            if(diff == num):
                if(ans >= num):
                    ans = num
    else:
        print(2)
    print(ans)


import sys
# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')

import math
import collections
from sys import stdin,stdout,setrecursionlimit
import bisect as bs
setrecursionlimit(2**20)
M = 10**9+7

T = int(stdin.readline())
# T = 1

def ceil(x,y):
    return x//y + (1 if x%y != 1 else 0)

def fun(x,h,c,t):
    return abs((x*c + (x+1)*h)/(2*x+1)-t)

for _ in range(T):
    # n = int(stdin.readline())
    h,c,t = list(map(int,stdin.readline().split()))
    # d = list(map(int,stdin.readline().split()))
    # q = list(map(int,stdin.readline().split()))
    # b = list(map(int,stdin.readline().split()))
    # s = stdin.readline().strip('\n')

    if(h == t):
        print(1)
        continue

    if((h+c)//2 == t):
        print(2)
        continue

    a = []
    x = ceil(t-h, c+h-2*t)
    y = (t-h)//(c+h-2*t)
    a.append([abs(((c+h)//2)-t),2])
    a.append([fun(x,h,c,t), 2*x+1])
    a.append([fun(y,h,c,t), 2*y+1])
    ans = a[0][1]
    mn = a[0][0]
    for diff, num in a[1:]:
        if(diff < mn):
            mn = diff
            ans = num
        if(diff == num):
            if(num < ans):
                ans = num
    print(ans)


import sys
# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')

import math
import collections
from sys import stdin,stdout,setrecursionlimit
import bisect as bs
setrecursionlimit(2**20)
M = 10**9+7

T = int(stdin.readline())
# T = 1

def ceil(x,y):
    return x//y + (1 if x%y != 0 else 0)

def fun(x,h,c,t):
    return abs((x*c + (x+1)*h)/(2*x+1)-t)

for _ in range(T):
    # n = int(stdin.readline())
    h,c,t = list(map(int,stdin.readline().split()))
    # d = list(map(int,stdin.readline().split()))
    # q = list(map(int,stdin.readline().split()))
    # b = list(map(int,stdin.readline().split()))
    # s = stdin.readline().strip('\n')

    if(h == t):
        print(1)
        continue

    if(t <= (h+c)/2):
        print(2)
        continue

    a = []
    x = ceil(h-t, 2*t-c-h)
    y = (h-t)//(2*t-c-h)

    num1 = y*c + (y+1)*h - (2*y+1)*t
    den1 = 2*y + 1
    num2 = (2*x+1)*t - x*c - (x+1)*h
    den2 = (2*x + 1)
    # print(x,y)
    print(num1,den1,num2,den2)
    if(num1*den2 - num2*den1 > 0):
        print(2*x+1)
    else:
        print(2*y+1)
    # a.append([abs(((c+h)/2)-t),2])
    # a.append([fun(x,h,c,t), 2*x+1])
    # a.append([fun(y,h,c,t), 2*y+1])
    # ans = a[0][1]
    # mn = a[0][0]
    # print(a)
    # for diff, num in a[1:]:
    #     # print(diff,num,ans)
    #     if(diff < mn):
    #         mn = diff
    #         ans = num
    #     if(diff == mn):
    #         # print('*')
    #         if(ans >= num):
    #             ans = num
    #     # print(mn,ans)

    # print(int(ans))


import sys
sys.stdin = open('input.txt', 'r')
sys.stdout = open('output.txt', 'w')

import math
import collections
from sys import stdin,stdout,setrecursionlimit
import bisect as bs
setrecursionlimit(2**20)
M = 10**9+7

T = int(stdin.readline())
# T = 1

def ceil(x,y):
    return x//y + (1 if x%y != 0 else 0)

def fun(x,h,c,t):
    return abs((x*c + (x+1)*h)/(2*x+1)-t)

for _ in range(T):
    # n = int(stdin.readline())
    h,c,t = list(map(int,stdin.readline().split()))
    # d = list(map(int,stdin.readline().split()))
    # q = list(map(int,stdin.readline().split()))
    # b = list(map(int,stdin.readline().split()))
    # s = stdin.readline().strip('\n')

    if(h == t):
        print(1)
        continue

    if(t <= (h+c)/2):
        print(2)
        continue

    a = []
    x = ceil(h-t, 2*t-c-h)
    y = (h-t)//(2*t-c-h)
    a.append([abs(((c+h)/2)-t),2])
    a.append([fun(x,h,c,t), 2*x+1])
    a.append([fun(y,h,c,t), 2*y+1])
    ans = a[0][1]
    mn = a[0][0]

    for diff, num in a[1:]:
        # print(diff,num,ans)
        if(diff < mn):
            mn = diff
            ans = num
        if(diff == mn):
            # print('*')
            if(ans >= num):
                ans = num
        # print(mn,ans)

    print(int(ans))


t = int(input())

ans=[0]*t

for i in range(t):
  h,c,obj=map(int, input().split())
  ave=(h+c)/2
  if obj<=ave:
    ans[i]=2
  else:
    x=obj-ave
    y=(h-c)/2
    z=y//x
    #print(x,y,z,ave)
    temp0=abs(obj-ave-y/z)
    temp1=abs(obj-ave-y/(1+z))
    #print(temp0,temp1,y/z)
    if temp0<=temp1:
      ans[i]=z
    else:
      ans[i]=z+1

for i in range(t):
  print(int(ans[i]))


t = int(input())

ans=[0]*t

for i in range(t):
  h,c,obj=map(int, input().split())
  ave=(h+c)/2
  if obj<=ave:
    ans[i]=2
  else:
    x=obj-ave
    y=(h-c)/2
    z=y//x
    if z%2==0:
      z-=1
    #print(x,y,z,ave)
    temp0=abs(obj-ave-y/z)
    temp1=abs(obj-ave-y/(2+z))
    #print(temp0,temp1,y/z)
    if temp0<=temp1:
      ans[i]=z
    else:
      ans[i]=z+2

for i in range(t):
  print(int(ans[i]))


from math import floor
from sys import stdin
input = stdin.readline

def compare_answer(hot, cold, target, moves, ans):
    min_temperature = (ans // 2) * (hot + cold) + (ans % 2) * hot
    min_error = abs(min_temperature - ans * target) * moves
    temperature = (moves // 2) * (hot + cold) + (moves % 2) * hot
    error =  abs(temperature - moves * target) * ans
    if error < min_error:
        ans = moves
    #print(f'moves  {moves}  error  {error}   ans  {ans}   min_error  {min_error}' )
    return ans

def main():
    test = int(input())
    for _ in range(test):
        hot, cold, target = map(int, input().split())
        avg = (hot + cold) / 2
        if target >= hot:
            ans = 1
        elif avg >= target:
            ans = 2
        else:
            moves = floor((hot - avg) / (target - avg))
            if moves % 2 == 0:
                moves -= 1
            ans = 2
            ans = compare_answer(hot, cold, target, moves, ans)
            ans = compare_answer(hot, cold, target, moves + 2, ans)
        print(ans)

if __name__ == "__main__":
    main()


from math import floor, fabs
from sys import stdin
input = stdin.readline

def compare_answer(hot, avg, target, moves, ans):
    min_temperature = avg + ((hot - avg) / ans) * (ans % 2)
    min_error = fabs(target - min_temperature)
    temperature = avg + ((hot - avg) / moves) * (moves % 2)
    error = fabs(target - temperature)
    if error < min_error:
        ans = moves
    return ans

def main():
    test = int(input())
    for _ in range(test):
        hot, cold, target = map(float, input().split())
        avg = (hot + cold) / 2
        if target >= hot:
            ans = 1
        elif avg >= target:
            ans = 2
        else:
            moves = floor((hot - avg) / (target - avg))
            if moves % 2 == 0:
                moves -= 1
            ans = 2
            ans = compare_answer(hot, avg, target, moves, ans)
            ans = compare_answer(hot, avg, target, moves + 2, ans)
        print(ans)

if __name__ == "__main__":
    main()


import sys
import math
def II():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def MI():
	return map(int, sys.stdin.readline().split())

def SI():
	return sys.stdin.readline().strip()
def solve(h,c,x,y):
	return (h*x+c*y)/(x+y)
t = II()
for q in range(t):
	h,c,t = MI()
	if (h+c)/2 >= t:
		print(2)
	elif h == t:
		print(1)
	else:
		x = round((h-t)/(2*t-h-c))
		m = abs(t-solve(h,c,x,x))
		ans = 2*x
		if abs(t-solve(h,c,x+1,x))<m:
			ans = x+x+1
		print(ans)


import sys
import math
from decimal import Decimal
def II():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def MI():
	return map(int, sys.stdin.readline().split())

def SI():
	return sys.stdin.readline().strip()
def solve(h,c,x,y):
	return Decimal((h*x+c*y))/Decimal((x+y))
t = II()
for q in range(t):
	h,c,t = MI()
	if (h+c)/2 >= t:
		print(2)
	elif h == t:
		print(1)
	else:
		x = Decimal((h-t))/Decimal((2*t-h-c))
		if x ==0:
			print(1)
		else:
			m = abs(t-solve(h,c,x,x))
			ans = 2*x
			if abs(t-solve(h,c,math.ceil(x+1),math.ceil(x)))<m:
				ans = math.ceil(x)+math.ceil(x)+1
				m = abs(t-solve(h,c,x+1,x))
			if abs(t-solve(h,c,math.floor(x),math.floor(x)-1))<m:
				ans = math.floor(x)+math.floor(x-1)+1
			print(ans)


for _ in range(int(input())):
    h,c,t=map(int,input().split())
    if(h==t):
        print(1)
    else:
        xx=(h+c)/2
        if(xx>=t):
            print(2)
        else:
            dif=(t-xx)
            j=int(abs((c-h)//(2*dif)))
            if(j%2==0):
                j+=1
            if(dif-(h-c)/(2*j)>=abs(dif-(h-c)/(2*(j-2)))):
                print(j-2)
            else:
                print(j)


import sys
import math
from decimal import Decimal
def II():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def MI():
	return map(int, sys.stdin.readline().split())

def SI():
	return sys.stdin.readline().strip()
def solve(h,c,x,y):
	return Decimal((h*x+c*y))/Decimal((x+y))
t = II()
for q in range(t):
	h,c,t = MI()
	if (h+c)/2 >= t:
		print(2)
	elif h == t:
		print(1)
	else:
		x = Decimal((h-t))/Decimal((2*t-h-c))
		if x ==0:
			print(1)
		else:
			m = abs(t-solve(h,c,x,x))
			ans = 2*x
			if abs(t-solve(h,c,math.ceil(x+1),math.ceil(x)))<m:
				ans = math.ceil(x)+math.ceil(x)+1
				m = abs(t-solve(h,c,x+1,x))
			if abs(t-solve(h,c,math.floor(x),math.floor(x)-1))<m:
				ans = math.floor(x)+math.floor(x-1)
			print(ans)


import sys
import math
def II():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def MI():
	return map(int, sys.stdin.readline().split())

def SI():
	return sys.stdin.readline().strip()
def solve(h,c,x,y):
	return (h*x+c*y)/(x+y)
t = II()
for q in range(t):
	h,c,t = MI()
	if (h+c)/2 >= t:
		print(2)
	elif h == t:
		print(1)
	else:
		x = round((h-t)/(2*t-h-c))
		if x ==0:
			print(1)
		else:
			m = abs(t-solve(h,c,x,x))
			ans = 2*x
			if abs(t-solve(h,c,x+1,x))<m:
				ans = x+x+1
			print(ans)


import sys
import math
def II():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def MI():
	return map(int, sys.stdin.readline().split())

def SI():
	return sys.stdin.readline().strip()
def solve(h,c,x,y):
	return (h*x+c*y)/(x+y)
t = II()
for q in range(t):
	h,c,t = MI()
	if (h+c)/2 >= t:
		print(2)
	elif h == t:
		print(1)
	else:
		x = round((h-t)/(2*t-h-c))
		if x ==0:
			print(1)
		else:
			m = abs(t-solve(h,c,x,x))
			ans = 2*x
			if abs(t-solve(h,c,x+1,x))<m:
				ans = x+x+1
				m = abs(t-solve(h,c,x+1,x))
			if abs(t-solve(h,c,x,x-1))<m:
				ans = x+x-1
			print(ans)


tests=int(input())
for _ in range(tests):
    h,c,t=map(int,input().split());
    if(t==h):
        print(1)
        continue
    if(t<=(h+c)/2):
        print(2)
        continue
    target=t-(h+c)/2
    dif=h-c
    tmp=int(dif//(2*target));
    val=500000000
    ans=0
    if(abs(target- dif/(2*tmp))<val):
        val=abs(target- dif/(2*tmp));
        ans=tmp
    if(abs(target -dif/(2*(tmp+1)))<val):
        ans=tmp+1
    print(ans)


tests=int(input())
for _ in range(tests):
    h,c,t=map(int,input().split());
    if(t==h):
        print(1)
        continue
    if(t<=(h+c)/2):
        print(2)
        continue
    target=t-(h+c)/2
    dif=h-c
    tmp=int(dif//(2*target));
    if(tmp<=0):
        tmp=1;
    if(tmp%2==0):
        tmp=tmp-1

    val=500000000
    ans=0
    if(abs(target- dif/(2*tmp))<val):
        val=abs(target- dif/(2*tmp));
        ans=tmp
    if(abs(target -dif/(2*(tmp+2)))<val):
        val=abs(target -dif/(2*(tmp+2)))
        ans=tmp+2
    if(abs(target-dif/(2*(tmp+4)))<val):
        ans=tmp+4

    print(ans)


def solve():
    h,c,t=[int(x) for x in input().split()]
    a=2*t-h-c
    b=h-t
    if a==0:
        print(2)
    else:
        if b/a==b//a:
            y=b//a
        else:
            y=int(b/a)+1
        if y%2==0:
            print(2*y)
        else:
            print(2*y+1)

t=int(input())
for i in range(t):
    solve()


from decimal import Decimal
def solve():
    h,c,t=[int(x) for x in input().split()]
    if h==t:
        print(1)
        return
    a=2*t-h-c
    b=h-t
    if a<=0:
        print(2)
        return
    else:
        c1=b//a
        c2=c1+1
        tc1=Decimal((h*(c1+1)+c*c1))/Decimal((2*c1+1))
        tc2=Decimal((h*(c2+1)+c*(c2)))/Decimal((2*c2+1))
        try1,try2=abs(tc1-t),abs(tc2-t)
        if try1<=try2:
            print(2*c1+1)
        else:
            print(2*c2+1)

t=int(input())
for i in range(t):
    solve()


def solve():
    h,c,t=[int(x) for x in input().split()]
    if h==t:
        print(1)
        return
    a=2*t-h-c
    b=h-t
    if a<=0:
        print(2)
        return
    else:
        c1=b//a
        tc1,tc2=(h*(c1+1)+c*c1)/(2*c1+1),(h*(c1+2)+c*(c1+1))/(2*(c1+1)+1)
        if min(abs(t-tc1),abs(t-tc2))==abs(t-tc1):
            print(2*c1+1)
            return
        else:
            print(2*(c1+1)+1)
            return

t=int(input())
for i in range(t):
    solve()


def solve():
    h,c,t=[int(x) for x in input().split()]
    a=2*t-h-c
    b=h-t
    if a==0:
        print(2)
    else:
        if b/a==b//a:
            y=b//a
        else:
            y=int(b/a)+1
        print(2*y+1)

t=int(input())
for i in range(t):
    solve()


def solve():
    h,c,t=[int(x) for x in input().split()]
    if h==t:
        print(1)
        return
    a=2*t-h-c
    b=t-c
    if a<=0:
        print(2)
        return
    else:
        c1=b//a
        c2=c1+1
        tc1,tc2=((h*(c1)+c*(c1-1))/(2*c1+1)),((h*(c2)+c*(c2-1))/(2*c2+1))
        try1,try2=abs(tc1-t),abs(tc2-t)
        if try1<=try2:
            print(2*c1-1)
        else:
            print(2*c2-1)

t=int(input())
for i in range(t):
    solve()


def solve():
    h,c,t=[int(x) for x in input().split()]
    if h==t:
        print(1)
        return
    a=2*t-h-c
    b=t-c
    if a<=0:
        print(2)
        return
    else:
        c1=b//a
        print(c1)
        c2=c1+1
        tc1,tc2=((h*(c1)+c*(c1-1))/(2*c1+1)),((h*(c2)+c*(c2-1))/(2*c2+1))
        try1,try2=abs(tc1-t),abs(tc2-t)
        if try1<=try2:
            print(2*c1-1)
        else:
            print(2*c2-1)

t=int(input())
for i in range(t):
    solve()


def solve():
    h,c,t=[int(x) for x in input().split()]
    if h==t:
        print(1)
        return
    a=2*t-h-c
    b=h-t
    if a<=0:
        print(2)
        return
    else:

        c1=b//a
        print(c1)
        c2=c1+1
        tc1,tc2=(h*(c1+1)+c*c1)/(2*c1+1),(h*(c2+1)+c*(c2))/(2*c2+1)
        try1,try2=abs(tc1-t),abs(tc2-t)
        if try1<=try2:
            print(2*c1+1)
        else:
            print(2*c2+1)

t=int(input())
for i in range(t):
    solve()


def solve():
    h,c,t=[int(x) for x in input().split()]
    if h==t:
        print(1)
        return
    a=2*t-h-c
    b=h-t
    if a<=0:
        print(2)
        return
    else:

        c1=b//a
        c2=c1+1
        tc1,tc2=(h*(c1+1)+c*c1)/(2*c1+1),(h*(c2+1)+c*(c2))/(2*c2+1)
        try1,try2=abs(tc1-t),abs(tc2-t)
        if tc1<=tc2:
            print(2*c1+1)
        else:
            print(2*c2+1)

t=int(input())
for i in range(t):
    solve()


def solve():
    h,c,t=[int(x) for x in input().split()]
    if h==t:
        print(1)
        return
    a=2*t-h-c
    b=h-t
    if a<=0:
        print(2)
        return
    else:
        c1=b//a
        c2=c1+1
        c3=c1-1
        tc1,tc2=(h*(c1+1)+c*c1)/(2*c1+1),(h*(c2+1)+c*(c2))/(2*c2+1)
        tc3=(h*(c3+1)+c*(c3))/(2*c3+1)
        if min(abs(t-tc1),abs(t-tc2),abs(t-tc3))==abs(t-tc1):
            print(2*c1+1)
            return
        elif min(abs(t-tc1),abs(t-tc2),abs(t-tc3))==abs(t-tc3):
            print(2*c3+1)
            return
        else:
            print(2*c2+1)
            return

t=int(input())
for i in range(t):
    solve()


def solve():
    h,c,t=[int(x) for x in input().split()]
    a=2*t-h-c
    b=h-t
    if a==0:
        print(2)
    else:
        if b/a==b//a:
            y=b//a
        else:
            y=round(b/a)
        print(2*y+1)

t=int(input())
for i in range(t):
    solve()


def solve():
    h,c,t=[int(x) for x in input().split()]
    a=2*t-h-c
    b=h-t
    if a==0:
        print(2)
    elif h==t:
        print(1)
    else:
        if b/a==b//a:
            y=b//a
        else:
            y=int(b/a)+1
        if y%2==0:
            print(2*y)
        else:
            print(2*y+1)

t=int(input())
for i in range(t):
    solve()


def solve():
    h,c,t=[int(x) for x in input().split()]
    if h==t:
        print(1)
        return
    a=2*t-h-c
    b=h-t
    y=b/a
    if a<=0:
        print(2)
        return
    else:
        c1=b//a
        tc1,tc2=h*(c1+1)+c*c1,h*(c1+2)+c*(c1+1)
        if min(abs(t-tc1),abs(t-tc2))==abs(t-tc1):
            print(c1)
            return
        else:
            print(c2)
            return

t=int(input())
for i in range(t):
    solve()


def solve():
    h,c,t=[int(x) for x in input().split()]
    if h==t:
        print(1)
        return
    a=2*t-h-c
    b=h-t
    if a<=0:
        print(2)
        return
    else:

        c1=b//a
        c2=c1+1
        tc1,tc2=(h*(c1+1)+c*c1)/(2*c1+1),(h*(c2+1)+c*(c2))/(2*c2+1)
        try1,try2=abs(tc1-t),abs(tc2-t)
        if try1<=try2:
            print(2*c1+1)
        else:
            print(2*c2+1)

t=int(input())
for i in range(t):
    solve()


tt=int(input())

while(tt):
    h,c,t=map(int,input().split())
    if h == t:
        print(1)
    elif t <= (h + c) / 2:
        print(2)
    else:
        k = (t - c - 1) // (2 * t - h - c)
        ans = 2 * k + 1
        if(((4 * k * k - 1) * (2 * t - h - c)) >= (2 * (h - c) * k)):
            ans -= 2
        print(ans)
    tt-=1


T = int(input())

for iteration in range(T):
    [h, c, t] = list(map(int, input().split()))
    if t <= (h+c)/2:
        print(2)
    else:
        k = 1/2 * (h-c)/(2*t-h-c)
        k = k + 1/(4*(int(k)+1))
        if k - int(k) <= 10**(-8):
            k = int(k) - 1
        else:
            k = int(k)
        print(2*k + 1)


T = int(input())

for iteration in range(T):
    [h, c, t] = list(map(int, input().split()))
    if t <= (h+c)/2:
        print(2)
    else:
        k = 1/2 * (h-c)/(2*t-h-c)
        k = int(k + 1/(4*(int(k)+1)))
        print(2*k + 1)


T = int(input())

for iteration in range(T):
    [h, c, t] = list(map(int, input().split()))
    if t == (h+c)/2:
        print(2)
    else:
        k = 1/2 * (h-c)/(2*t-h-c)
        k = int(k + 1/(4*(int(k)+1)))
        print(2*k + 1)


# Nilfer
for _ in range(int(input())):
    p,a,t=map(int,input().split())
    if t<=(p+a)/2:print(2)
    else:
        k=(p-t)//(2*t-p-a)
        if abs((2*k+3)*t-k*p-2*p-k*a-a)*(2*k+1)<abs((2*k+1)*t-k*p-p-k*a)*(2*k+3):print(2*k+3)
        else:print(2*k+1)


import sys
from decimal import Decimal

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
INF = 10 ** 10
MOD = 10 ** 9 + 7
EPS = 10 ** -10

def bisearch_max(mn, mx, func):
    ok = mn
    ng = mx
    while ok+1 < ng:
        mid = (ok+ng) // 2
        if func(mid):
            ok = mid
        else:
            ng = mid
    return ok

# m*2+1回カップを入れた時、温度がt以上かどうか
def check(m):
    res = (h*(m+1) + c*m) / (m*2+1)
    return res >= t

for _ in range(INT()):
    h, c, t = map(Decimal, input().split())

    ev = (h+c) / 2
    res = bisearch_max(0, 10**6, check)
    if res == 10**6-1:
        print(2)
    else:
        mn = INF
        ans = -1
        for m in range(res, res+2):
            res = (h*(m+1) + c*m) / (m*2+1)
            diff = abs(res - t)
            if diff < mn:
                mn = diff
                ans = m*2 + 1
        print(ans)


import sys
from decimal import Decimal

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
INF = 10 ** 19
MOD = 10 ** 9 + 7
EPS = 10 ** -10

def bisearch_max(mn, mx, func):
    ok = mn
    ng = mx
    while ok+1 < ng:
        mid = (ok+ng) // 2
        if func(mid):
            ok = mid
        else:
            ng = mid
    return ok

# m*2+1回カップを入れた時、温度がt以上かどうか
def check(m):
    res = (h*(m+1) + c*m) / (m*2+1)
    return res >= t

for _ in range(INT()):
    h, c, t = map(Decimal, input().split())

    ev = (h+c) / 2
    res = bisearch_max(0, INF, check)
    if res == INF-1:
        print(2)
    else:
        mn = INF
        ans = -1
        for m in range(max(res-100, 0), res+100):
            res = (h*(m+1) + c*m) / (m*2+1)
            diff = abs(res - t)
            if diff < mn:
                mn = diff
                ans = m*2 + 1
        print(ans)


import sys
from decimal import Decimal

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
INF = 10 ** 10
MOD = 10 ** 9 + 7
EPS = 10 ** -10

def bisearch_max(mn, mx, func):
    ok = mn
    ng = mx
    while ok+1 < ng:
        mid = (ok+ng) // 2
        if func(mid):
            ok = mid
        else:
            ng = mid
    return ok

# m*2+1回カップを入れた時、温度がt以上かどうか
def check(m):
    res = (h*(m+1) + c*m) / (m*2+1)
    return res >= t

for _ in range(INT()):
    h, c, t = map(Decimal, input().split())

    ev = (h+c) / 2
    res = bisearch_max(0, 10**6, check)
    if res == 10**6-1:
        print(2)
    else:
        mn = INF
        ans = -1
        for m in range(max(res-10, 0), res+10):
            res = (h*(m+1) + c*m) / (m*2+1)
            diff = abs(res - t)
            if diff < mn:
                mn = diff
                ans = m*2 + 1
        print(ans)