1234567891011121314151617181920212223242526272829
#include<cstdio>#include<algorithm>#include<iostream>using namespace std;int n, a[100010], t;int main() { int T; scanf("%d", &T); while (T--) { scanf("%d%d", &n, &t); for (int i = 0; i < n; ++i) scanf("%d", &a[i]); sort(a, a+n); int l = 0; int r = n-1; while (l <= r) { int mid = (l+r) >> 1; if (a[mid] < t) l = mid +1; else r = mid -1; } double ans = (double)l/(double)n; ans *= 100; printf("%.2f", ans); cout << "%" << endl; } return 0;}
返回