mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
25 lines
436 B
C++
25 lines
436 B
C++
|
#include <iostream>
|
||
|
#include <cstdlib>
|
||
|
#include <cstdio>
|
||
|
#include <cstring>
|
||
|
using namespace std;
|
||
|
int a[20];
|
||
|
int b[20];
|
||
|
int main(){
|
||
|
int test,n;
|
||
|
scanf("%d",&test);
|
||
|
while (test--){
|
||
|
scanf("%d",&n);
|
||
|
for (int i=0;i<n;i++)
|
||
|
scanf("%d",&a[i]);
|
||
|
for (int j=0;j<n;j++)
|
||
|
scanf("%d",&b[j]);
|
||
|
int ans=0;
|
||
|
for (int i=0;i<n;i++)
|
||
|
for (int j=0;j<n;j++)
|
||
|
if (b[i]>a[j]) ans+=3;
|
||
|
printf("%.6lf\n",ans*1.0/n);
|
||
|
}
|
||
|
return 0;
|
||
|
}
|