import java.util.*;
public class add {
    public static void main(String args[]){
        Scanner sc=new Scanner(System.in);
        int t=sc.nextInt();
        while(t-->0){
            int n=sc.nextInt();
            int k=sc.nextInt();
            int[] ans=new int[n];
            int[] rem=new int[k];
            for(int i=0;i<n;i++){
                ans[i]=sc.nextInt();
                if(ans[i]%k!=0){
                    rem[k-ans[i]%k]++;
                }
            }
            int max=0,count=0;
            for(int j=1;j<k;j++){
                if(rem[j]>max){
                    max=rem[j];
                }
            }
            int i;
            if(max>1){
                for(i=k-1;i>0;i--){
                    if(rem[i]==max){
                        break;
                    }
                }
                count=i+((rem[i]-1)*k)+1;
            }
            else{
                if(max==0){
                    count=0;
                }
                else{
                    for(i=k-1;i>0;i--){
                        if(rem[i]==max){
                            break;
                        }
                    }
                    count=i+1;
                }

            }
            System.out.println(count);
        }
    }
}


import java.util.*;
public class add {
    public static void main(String args[]){
        Scanner sc=new Scanner(System.in);
        int t=sc.nextInt();
        while(t-->0){
            int n=sc.nextInt();
            int k=sc.nextInt();
            int[] ans=new int[n];
            int[] rem=new int[k];
            for(int i=0;i<n;i++){
                ans[i]=sc.nextInt();
                rem[ans[i]%k]++;
            }
            int max=0,count=0;
            for(int j=1;j<k;j++){
                if(rem[j]>max){
                    max=rem[j];
                }
            }
            int i;
            if(max>1){
                for(i=1;i<k;i++){
                    if(rem[i]==max){
                        break;
                    }
                }
                count=(k-i)+((rem[i]-1)*k)+1;
            }
            else{
                if(max==0){
                    count=0;
                }
                else{
                    for(i=k-1;i>0;i--){
                        if(rem[i]==max){
                            break;
                        }
                    }
                    count=i+1;
                }

            }
            System.out.println(count);
        }
    }
}


import java.util.Collections;
import java.util.LinkedList;
import java.util.Scanner;

public class zeroRemainderArray {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int tt = scan.nextInt();
		scan.nextLine();

		for(int t = 0; t < tt; t++)
		{
			int n = scan.nextInt();
			int k = scan.nextInt();

			LinkedList<Integer> list = new LinkedList<Integer>();
			for(int i = 0; i < n; i++)
				list.add((k - (scan.nextInt() % k)) % k);

			long count = 0;
			long x = 0;

			Collections.sort(list);

			while(!list.isEmpty() && list.getFirst() == 0)
				list.pop();

			while(!list.isEmpty())
			{
				int element = list.pop();
				if(x == element)
				{
					x++;
					count++;
				}

				else if(x < element)
				{
					count += (element - x);
					x = element;
					count++;
					x++;
				}

				else
				{
					list.add(element + k);
				}
			}

			System.out.println(count);

		}
	}

}


import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
import java.util.Scanner;

public class zeroRemainderArray {

	public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		int tt = scan.nextInt();

		for(int t = 0; t < tt; t++) {
			int n = scan.nextInt();
			int k = scan.nextInt();

			int[] ray = new int[n];
			for(int i = 0; i < n; i++)
				ray[i] = (k - (scan.nextInt() % k)) % k;

			Arrays.sort(ray);

			long highestCount = 0;
			long highest = 0;
			long last = 0;

			int count = 0;

			for(int i = 0; i < n; i++)
			{
				if(ray[i] == 0)
					continue;

				if(last == ray[i])
				{
					count++;

					if(i == n-1)
					{
						if(count >= highestCount)
						{
							highestCount = count;
							highest = ray[i];
						}
					}
				}

				else
				{
					if(count >= highestCount)
					{
						highestCount = count;
						highest = ray[i];
					}

					count = 1;
					last = ray[i];
				}
			}

			if(count >= highestCount)
			{
				highestCount = count;
				highest = ray[ray.length - 1];
			}

			System.out.println(Math.max(0, ((highestCount-1)*k) + highest + 1));

		}
	}

	/*public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int tt = scan.nextInt();
		scan.nextLine();

		for(int t = 0; t < tt; t++)
		{
			int n = scan.nextInt();
			int k = scan.nextInt();

			LinkedList<Integer> list = new LinkedList<Integer>();
			for(int i = 0; i < n; i++)
				list.add((k - (scan.nextInt() % k)) % k);

			long count = 0;
			long x = 0;

			Collections.sort(list);

			while(!list.isEmpty() && list.getFirst() == 0)
				list.pop();

			while(!list.isEmpty())
			{
				int element = list.pop();
				if(x == element)
				{
					x++;
					count++;
				}

				else if(x < element)
				{
					count += (element - x);
					x = element;
					count++;
					x++;
				}

				else
				{
					list.add(element + k);
				}
			}

			System.out.println(count);

		}
	}*/

}


import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
import java.util.Scanner;

public class zeroRemainderArray {

	public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		int tt = scan.nextInt();

		for(int t = 0; t < tt; t++) {
			int n = scan.nextInt();
			int k = scan.nextInt();

			int[] ray = new int[n];
			for(int i = 0; i < n; i++)
				ray[i] = (k - (scan.nextInt() % k)) % k;

			Arrays.sort(ray);

			long highestCount = 0;
			int highest = 0;
			int last = 0;

			int count = 0;

			for(int i = 0; i < n; i++)
			{
				if(ray[i] == 0)
					continue;

				if(last == ray[i])
				{
					count++;

					if(i == n-1)
					{
						if(count >= highestCount)
						{
							highestCount = count;
							highest = ray[i];
						}
					}
				}

				else
				{
					if(count >= highestCount)
					{
						highestCount = count;
						highest = ray[i];
					}

					count = 1;
					last = ray[i];
				}
			}

			System.out.println(Math.max(0, ((highestCount-1)*k) + highest + 1));

		}
	}

	/*public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int tt = scan.nextInt();
		scan.nextLine();

		for(int t = 0; t < tt; t++)
		{
			int n = scan.nextInt();
			int k = scan.nextInt();

			LinkedList<Integer> list = new LinkedList<Integer>();
			for(int i = 0; i < n; i++)
				list.add((k - (scan.nextInt() % k)) % k);

			long count = 0;
			long x = 0;

			Collections.sort(list);

			while(!list.isEmpty() && list.getFirst() == 0)
				list.pop();

			while(!list.isEmpty())
			{
				int element = list.pop();
				if(x == element)
				{
					x++;
					count++;
				}

				else if(x < element)
				{
					count += (element - x);
					x = element;
					count++;
					x++;
				}

				else
				{
					list.add(element + k);
				}
			}

			System.out.println(count);

		}
	}*/

}


import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map.Entry;
import java.util.Scanner;

public class zeroRemainderArray {

	/*public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		int tt = scan.nextInt();

		for(int t = 0; t < tt; t++) {
			int n = scan.nextInt();
			int k = scan.nextInt();

			int[] ray = new int[n];
			for(int i = 0; i < n; i++)
				ray[i] = (k - (scan.nextInt() % k)) % k;

			Arrays.sort(ray);

			long highestCount = 0;
			long highest = 0;
			long last = 0;

			int count = 0;

			for(int i = 0; i < n; i++)
			{
				if(ray[i] == 0)
					continue;

				if(last == ray[i])
				{
					count++;

					if(i == n-1)
					{
						if(count >= highestCount)
						{
							highestCount = count;
							highest = ray[i];
						}
					}
				}

				else
				{
					if(count >= highestCount)
					{
						highestCount = count;
						highest = ray[i];
					}

					count = 1;
					last = ray[i];
				}
			}

			if(count >= highestCount)
			{
				highestCount = count;
				highest = ray[ray.length - 1];
			}

			System.out.println(Math.max(0, ((highestCount-1)*k) + highest + 1));

		}
	} */

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int tt = scan.nextInt();
		scan.nextLine();

		for(int t = 0; t < tt; t++)
		{
			int n = scan.nextInt();
			long k = scan.nextInt();

			LinkedList<Long> list = new LinkedList<Long>();
			for(int i = 0; i < n; i++)
				list.add((k - (scan.nextInt() % k)) % k);

			Collections.sort(list);

			while(!list.isEmpty() && list.getFirst() == 0)
				list.pop();

			HashMap<Long, Long> multiply = new HashMap<Long, Long>();
			while(!list.isEmpty())
			{
				long element = list.pop();

				if(multiply.containsKey(element))
					multiply.put(element, multiply.get(element) + 1);
				else
					multiply.put(element, (long) 1);

			}

			long max = 0;
			for(Entry<Long, Long> e : multiply.entrySet())
			{
				if((e.getValue() - 1) * k + e.getKey() > max)
					max = (e.getValue() - 1) * k + e.getKey();
			}

			System.out.println(max == 0 ? 0 : max+1);

		}
	}

	/*public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int tt = scan.nextInt();
		scan.nextLine();

		for(int t = 0; t < tt; t++)
		{
			int n = scan.nextInt();
			int k = scan.nextInt();

			LinkedList<Integer> list = new LinkedList<Integer>();
			for(int i = 0; i < n; i++)
				list.add((k - (scan.nextInt() % k)) % k);

			long count = 0;
			long x = 0;

			Collections.sort(list);

			while(!list.isEmpty() && list.getFirst() == 0)
				list.pop();

			while(!list.isEmpty())
			{
				int element = list.pop();
				if(x == element)
				{
					x++;
					count++;
				}

				else if(x < element)
				{
					count += (element - x);
					x = element;
					count++;
					x++;
				}

				else
				{
					list.add(element + k);
				}
			}

			System.out.println(count);

		}
	}*/
}


import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map.Entry;
import java.util.Scanner;

public class zeroRemainderArray {

	/*public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		int tt = scan.nextInt();

		for(int t = 0; t < tt; t++) {
			int n = scan.nextInt();
			int k = scan.nextInt();

			int[] ray = new int[n];
			for(int i = 0; i < n; i++)
				ray[i] = (k - (scan.nextInt() % k)) % k;

			Arrays.sort(ray);

			long highestCount = 0;
			long highest = 0;
			long last = 0;

			int count = 0;

			for(int i = 0; i < n; i++)
			{
				if(ray[i] == 0)
					continue;

				if(last == ray[i])
				{
					count++;

					if(i == n-1)
					{
						if(count >= highestCount)
						{
							highestCount = count;
							highest = ray[i];
						}
					}
				}

				else
				{
					if(count >= highestCount)
					{
						highestCount = count;
						highest = ray[i];
					}

					count = 1;
					last = ray[i];
				}
			}

			if(count >= highestCount)
			{
				highestCount = count;
				highest = ray[ray.length - 1];
			}

			System.out.println(Math.max(0, ((highestCount-1)*k) + highest + 1));

		}
	} */

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int tt = scan.nextInt();
		scan.nextLine();

		for(int t = 0; t < tt; t++)
		{
			int n = scan.nextInt();
			int k = scan.nextInt();

			LinkedList<Integer> list = new LinkedList<Integer>();
			for(int i = 0; i < n; i++)
				list.add((k - (scan.nextInt() % k)) % k);

			Collections.sort(list);

			while(!list.isEmpty() && list.getFirst() == 0)
				list.pop();

			HashMap<Integer, Integer> multiply = new HashMap<Integer, Integer>();
			while(!list.isEmpty())
			{
				int element = list.pop();

				if(multiply.containsKey(element))
					multiply.put(element, multiply.get(element) + 1);
				else
					multiply.put(element, 1);

			}

			long max = 0;
			for(Entry<Integer, Integer> e : multiply.entrySet())
			{
				if((e.getValue() - 1) * k + e.getKey() > max)
					max = (e.getValue() - 1) * k + e.getKey();
			}

			System.out.println(max == 0 ? 0 : max+1);

		}
	}

	/*public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int tt = scan.nextInt();
		scan.nextLine();

		for(int t = 0; t < tt; t++)
		{
			int n = scan.nextInt();
			int k = scan.nextInt();

			LinkedList<Integer> list = new LinkedList<Integer>();
			for(int i = 0; i < n; i++)
				list.add((k - (scan.nextInt() % k)) % k);

			long count = 0;
			long x = 0;

			Collections.sort(list);

			while(!list.isEmpty() && list.getFirst() == 0)
				list.pop();

			while(!list.isEmpty())
			{
				int element = list.pop();
				if(x == element)
				{
					x++;
					count++;
				}

				else if(x < element)
				{
					count += (element - x);
					x = element;
					count++;
					x++;
				}

				else
				{
					list.add(element + k);
				}
			}

			System.out.println(count);

		}
	}*/
}


import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class ProblemA {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int t = in.nextInt();
		in.nextLine();
		for (int i = 0; i < t; i++) {
			System.out.println(solve(in));
		}
	}

	private static int solve(Scanner in) {
		int n = in.nextInt();
		int k = in.nextInt();

		Map<Integer, Integer> map = new HashMap<>();

		for (int i = 0; i < n; i++) {
			int a = in.nextInt();
			if (a % k == 0) continue;

			if (!map.containsKey(a % k)) {
				map.put(a % k, 0);
			}
			map.put(a % k, map.get(a % k) + 1);
		}

		if (map.isEmpty()) {
			return 0;
		}

		int maxKey = 0;
		int maxVal = 1;

		for (int key : map.keySet()) {
			int val = map.get(key);

			maxVal = Math.max(val, maxVal);
			maxKey = Math.max(k - key, maxKey);
		}

		return (maxKey + (maxVal - 1) * k + 1);
	}
}


import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class ProblemA {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int t = in.nextInt();
		in.nextLine();
		for (int i = 0; i < t; i++) {
			System.out.println(solve(in));
		}
	}

	private static long solve(Scanner in) {
		int n = in.nextInt();
		int k = in.nextInt();

		Map<Integer, Integer> map = new HashMap<>();

		for (int i = 0; i < n; i++) {
			int a = in.nextInt();
			if (a % k == 0) continue;

			if (!map.containsKey(a % k)) {
				map.put(a % k, 0);
			}
			map.put(a % k, map.get(a % k) + 1);
		}

		if (map.isEmpty()) {
			return 0;
		}

		long maxAdd = 0;
		long maxVal = 1;

		for (int key : map.keySet()) {
			int val = map.get(key);
			maxVal = Math.max(val, maxVal);
		}

		for (int key : map.keySet()) {
			if (map.get(key) == maxVal)
				maxAdd = Math.max(k - key, maxAdd);
		}

		return (maxAdd  + (maxVal - 1) * k + 1);
	}
}


import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class ProblemA {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int t = in.nextInt();
		in.nextLine();
		for (int i = 0; i < t; i++) {
			System.out.println(solve(in));
		}
	}

	private static int solve(Scanner in) {
		int n = in.nextInt();
		int k = in.nextInt();

		Map<Integer, Integer> map = new HashMap<>();

		for (int i = 0; i < n; i++) {
			int a = in.nextInt();
			if (a % k == 0) continue;

			if (!map.containsKey(a % k)) {
				map.put(a % k, 0);
			}
			map.put(a % k, map.get(a % k) + 1);
		}

		if (map.isEmpty()) {
			return 0;
		}

		int maxAdd = 0;
		int maxVal = 1;

		for (int key : map.keySet()) {
			int val = map.get(key);

			maxVal = Math.max(val, maxVal);
			maxAdd = Math.max(k - key, maxAdd);
		}

		return (maxAdd  + (maxVal - 1) * k + 1);
	}
}


import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class ProblemA {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int t = in.nextInt();
		in.nextLine();
		for (int i = 0; i < t; i++) {
			System.out.println(solve(in));
		}
	}

	private static long solve(Scanner in) {
		int n = in.nextInt();
		int k = in.nextInt();

		Map<Integer, Integer> map = new HashMap<>();

		for (int i = 0; i < n; i++) {
			int a = in.nextInt();
			if (a % k == 0) continue;

			if (!map.containsKey(a % k)) {
				map.put(a % k, 0);
			}
			map.put(a % k, map.get(a % k) + 1);
		}

		if (map.isEmpty()) {
			return 0;
		}

		long maxAdd = 0;
		long maxVal = 1;

		for (int key : map.keySet()) {
			int val = map.get(key);

			maxVal = Math.max(val, maxVal);
			maxAdd = Math.max(k - key, maxAdd);
		}

		return (maxAdd  + (maxVal - 1) * k + 1);
	}
}


import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();

		for (int z = 0; z < t; z++)
		{
			int n= sc.nextInt();
			int k= sc.nextInt();
			long l= -1;

			Map<Integer, Integer> m= new HashMap<>();
			for(int i=0; i<n; i++)
			{
				int j= k-sc.nextInt()%k;
				int jj;
				if(j!=k)
				{
					if(m.containsKey(j))
					{
						jj= m.get(j)*k+j;
						m.put(j, m.get(j)+1);
					}
					else
					{
						jj= j;
						m.put(j, 1);
					}
					if(l<jj)
						l=jj;
				}
			}

			System.out.println(l+1);
		}
	}
}


import java.util.HashMap;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;

import java.util.TreeSet;

import java.util.Set;
import java.util.HashSet;
import java.util.Stack;
import java.util.List;
import java.util.Map;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();

		for (int z = 0; z < t; z++)
		{
			int n= sc.nextInt();
			int k= sc.nextInt();
			long l= -1;

			Map<Long, Long> m= new HashMap<>();
			for(int i=0; i<n; i++)
			{
				long j= k-sc.nextInt()%k;
				long jj;
				if(j!=k)
				{
					if(m.containsKey(j))
					{
						jj= m.get(j)*k+j;
						m.put(j, m.get(j)+1);
					}
					else
					{
						jj= j;
						m.put(j, 1L);
					}
					if(l<jj)
						l=jj;
				}
			}

			System.out.println(l+1);
		}
	}
}


import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;

public class Main
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();

		for (int z = 0; z < t; z++)
		{
			int n= sc.nextInt();
			int k= sc.nextInt();

			List<Integer> list = new ArrayList<>();
			for(int i=0; i<n; i++)
			{
				int j= (sc.nextInt()%k);
				if(j!=0)
					list.add(k-j);
			}

			if(list.isEmpty())
				System.out.println("0");
			else
			{
				for(int i=1; i<list.size(); i++)
				{
					int j=i;
					Collections.sort(list);
					while(j!=list.size())
					{
						if(list.get(j-1)-list.get(j)==0)
						{
							list.add(list.remove(j)+k);
							Collections.sort(list);
						}
						else
							j++;

					}

				}

				System.out.println(list.get(list.size()-1)+1);
			}
		}
	}
}


import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();

		for (int z = 0; z < t; z++)
		{
			int n= sc.nextInt();
			int k= sc.nextInt();

			long[] nn= new long[n];
			for(int i=0; i<n; i++)
			{
				int j= sc.nextInt();
				if(j%k!=0)
					nn[k-j%k]++;
			}

			List<Long> l= new ArrayList<>();
			l.add(-1L);
			for(int i=0; i<n; i++)
				if(nn[i]!=0)
					l.add((i+(nn[i]-1)*k));

			Collections.sort(l);
			System.out.println(l.get(l.size()-1)+1);
		}
	}
}


import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;

public class Main
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();

		for (int z = 0; z < t; z++)
		{
			int n= sc.nextInt();
			int k= sc.nextInt();

			List<Integer> list = new ArrayList<>();
			for(int i=0; i<n; i++)
			{
				int j= (sc.nextInt()%k);
				if(j!=0)
					list.add(k-j);
			}

			if(list.isEmpty())
				System.out.println("0");
			else
			{
				boolean b= true;
				while(b)
				{
					for(int i=1; i<list.size(); i++)
					{
						b=false;
						int j=i;
						Collections.sort(list);
						while(j!=list.size())
						{
							if(list.get(j-1)-list.get(j)==0)
							{
								list.add(list.remove(j)+k);
								Collections.sort(list);
								b=true;
							}
							else
							{
								j++;
							}
						}
					}
				}

				System.out.println(list.get(list.size()-1)+1);
			}
		}
	}
}


import java.util.HashMap;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;

import java.util.TreeSet;

import java.util.Set;
import java.util.HashSet;
import java.util.Stack;
import java.util.List;
import java.util.Map;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();

		for (int z = 0; z < t; z++)
		{
			int n= sc.nextInt();
			int k= sc.nextInt();
			long l= -1;

			Map<Integer, Integer> m= new HashMap<>();
			for(int i=0; i<n; i++)
			{
				int j= k-sc.nextInt()%k;
				long jj;
				if(j!=k)
				{
					if(m.containsKey(j))
					{
						jj= m.get(j)*k+j;
						m.put(j, m.get(j)+1);
					}
					else
					{
						jj= j;
						m.put(j, 1);
					}
					if(l<jj)
						l=jj;
				}
			}

			System.out.println(l+1);
		}
	}
}


#include <bits/stdc++.h>

using namespace std;

#define sd(x) scanf("%d", &x)
#define boost ios_base::sync_with_stdio(false);
#define mp make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define f first
#define s second

typedef pair<int, int> pii;
typedef long long ll;

const int mod = 1000000007;
const int inf = 50000000;
const int maxn = 1000010;
const int logn = 21;

int mxv[logn][maxn], mnc[logn][maxn];
double potential[maxn];
int v[maxn], c[maxn], n, k;

void pre()
{
    int i, j;
    for(i=1; i<logn; i++){
        for(j=1; j<=n; j++){
            mxv[i][j] = max(mxv[i-1][j], mxv[i-1][min(n, j+(1<<(i-1)))]);
            mnc[i][j] = min(mnc[i-1][j], mnc[i-1][min(n, j+(1<<(i-1)))]);
        }
    }
}

int find(int x, int y)
{
    if(x>y)
        return 0;
    int diff = y-x+1;
    int lg = log2(diff);
    int ret = max(mxv[lg][x], mxv[lg][y-(1<<lg)+1]);
    ret = min(ret, min(mnc[lg][x], mnc[lg][y-(1<<lg)+1]));
    return ret;
}

int findR(int x, int y)
{
    int diff = y-x+1;
    int lg = log2(diff);
    int ret = max(mxv[lg][x], mxv[lg][y-(1<<lg)+1]);
    return ret;
}

int findC(int x, int y)
{
    int diff = y-x+1;
    int lg = log2(diff);
    int ret = min(mnc[lg][x], mnc[lg][y-(1<<lg)+1]);
    return ret;
}

int find_cut(int x)
{
    int i, j;
    int r1 = v[x]*100;
    int r2 = c[x];
    for(i=logn-1; i>=0; i--){
        if(max(r1, mxv[i][x]) < min(r2, mnc[i][x])){
            r1 = max(r1, mxv[i][x]);
            r2 = min(r2, mnc[i][x]);
            x = min(x + (1<<i), n);
        }
    }
    return x;
}

double solve()
{
    int i, j;
    double ret = 0, prev, num, den;
    prev = (double)k/n;
    ret = prev*potential[1];
    num = n-k;
    den = n-1;
    for(i=2; i<=(n-k+1) && num>0 && den>0; i++){
        prev = (prev*(num/den));
        ret += (prev*potential[i]);
        num--;
        den--;
    }
    return ret;
}

int main()
{
    //freopen("i.txt", "r", stdin);
    //freopen("o.txt", "w", stdout);
    int i, j, cut, lo, mid, hi;
    scanf("%d%d", &n, &k);
    for(i=1; i<=n; i++){
        scanf("%d", &v[i]);
        mxv[0][i] = v[i]*100;
    }
    for(i=1; i<=n; i++){
        scanf("%d", &c[i]);
        mnc[0][i] = c[i];
    }
    pre();
    for(i=1; i<=n; i++){
        cut = lo = i;
        hi = n;
        while(lo+1 < hi){
            mid = (lo+hi)>>1;
            if(findR(i, mid) <= findC(i, mid))
                lo = mid;
            else
                hi = mid;
        }
        potential[i] = max(find(i, lo), find(i, min(n, lo+1)));
    }
    sort(potential+1, potential+n+1);
    double ans = solve();
    printf("%.10lf\n", ans);
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define sd(x) scanf("%d", &x)
#define boost ios_base::sync_with_stdio(false);
#define mp make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define f first
#define s second

typedef pair<int, int> pii;
typedef long long ll;

const int mod = 1000000007;
const int inf = 50000000;
const int maxn = 1000010;
const int logn = 21;

int mxv[logn][maxn], mnc[logn][maxn];
double potential[maxn];
int v[maxn], c[maxn], n, k;

void pre()
{
    int i, j;
    for(i=1; i<logn; i++){
        for(j=1; j<=n; j++){
            mxv[i][j] = max(mxv[i-1][j], mxv[i-1][min(n, j+(1<<(i-1)))]);
            mnc[i][j] = min(mnc[i-1][j], mnc[i-1][min(n, j+(1<<(i-1)))]);
        }
    }
}

int find(int x, int y)
{
    if(x>y)
        return 0;
    int diff = y-x+1;
    int lg = log2(diff);
    int ret = min(mxv[lg][x], mnc[lg][y-(1<<lg)+1]);
    return ret;
}

int find_cut(int x)
{
    int i, j;
    int r1 = v[x]*100;
    int r2 = c[x];
    for(i=logn-1; i>=0; i--){
        if(max(r1, mxv[i][x]) <= min(r2, mnc[i][x])){
            r1 = max(r1, mxv[i][x]);
            r2 = min(r2, mnc[i][x]);
            x = min(x + (1<<i), n);
        }
    }
    return x;
}

double solve()
{
    int i, j;
    double ret = 0, prev, num, den;
    prev = (double)k/n;
    ret = prev*potential[1];
    num = n-k;
    den = n-1;
    for(i=2; i<=(n-k+1); i++){
        prev = (prev*(num/den));
        ret += (prev*potential[i]);
        num--;
        den--;
    }
    return ret;
}

int main()
{
    //freopen("i.txt", "r", stdin);
    //freopen("o.txt", "w", stdout);
    int i, j, cut;
    scanf("%d%d", &n, &k);
    for(i=1; i<=n; i++){
        scanf("%d", &v[i]);
        mxv[0][i] = v[i]*100;
    }
    for(i=1; i<=n; i++){
        scanf("%d", &c[i]);
        mnc[0][i] = c[i];
    }
    pre();
    for(i=1; i<=n; i++){
        cut = find_cut(i);
        potential[i] = max(find(i, cut), max(find(i, min(cut+1, n)), find(i, cut-1)));
    }
    sort(potential+1, potential+n+1);
    double ans = solve();
    printf("%.10lf\n", ans);
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define sd(x) scanf("%d", &x)
#define boost ios_base::sync_with_stdio(false);
#define mp make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define f first
#define s second

typedef pair<int, int> pii;
typedef long long ll;

const int mod = 1000000007;
const int inf = 50000000;
const int maxn = 1000010;
const int logn = 21;

int mxv[logn][maxn], mnc[logn][maxn];
double potential[maxn];
int v[maxn], c[maxn], n, k;

void pre()
{
    int i, j;
    for(i=1; i<logn; i++){
        for(j=1; j<=n; j++){
            mxv[i][j] = max(mxv[i-1][j], mxv[i-1][min(n, j+(1<<(i-1)))]);
            mnc[i][j] = min(mnc[i-1][j], mnc[i-1][min(n, j+(1<<(i-1)))]);
        }
    }
}

int find(int x, int y)
{
    if(x>y)
        return 0;
    int diff = y-x+1;
    int lg = log2(diff);
    int ret = min(mxv[lg][x], mnc[lg][y-(1<<lg)+1]);
    return ret;
}

int find_cut(int x)
{
    int i, j;
    int r1 = v[x]*100;
    int r2 = c[x];
    for(i=logn-1; i>=0; i--){
        if(max(r1, mxv[i][x]) < min(r2, mnc[i][x])){
            r1 = max(r1, mxv[i][x]);
            r2 = min(r2, mnc[i][x]);
            x = min(x + (1<<i), n);
        }
    }
    return x;
}

double solve()
{
    int i, j;
    double ret = 0, prev, num, den;
    prev = (double)k/n;
    ret = prev*potential[1];
    num = n-k;
    den = n-1;
    for(i=2; i<=(n-k+1) && num>0 && den>0; i++){
        prev = (prev*(num/den));
        ret += (prev*potential[i]);
        num--;
        den--;
    }
    return ret;
}

int main()
{
    //freopen("i.txt", "r", stdin);
    //freopen("o.txt", "w", stdout);
    int i, j, cut;
    scanf("%d%d", &n, &k);
    for(i=1; i<=n; i++){
        scanf("%d", &v[i]);
        mxv[0][i] = v[i]*100;
    }
    for(i=1; i<=n; i++){
        scanf("%d", &c[i]);
        mnc[0][i] = c[i];
    }
    pre();
    for(i=1; i<=n; i++){
        cut = find_cut(i);
        potential[i] = max(find(i, cut), max(find(i, min(cut+1, n)), find(i, cut-1)));
    }
    sort(potential+1, potential+n+1);
    double ans = solve();
    printf("%.10lf\n", ans);
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define sd(x) scanf("%d", &x)
#define boost ios_base::sync_with_stdio(false);
#define mp make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define f first
#define s second

typedef pair<int, int> pii;
typedef long long ll;

const int mod = 1000000007;
const int inf = 50000000;
const int maxn = 1000010;
const int logn = 21;

int mxv[logn][maxn], mnc[logn][maxn];
double potential[maxn];
int v[maxn], c[maxn], n, k;

void pre()
{
    int i, j;
    for(i=1; i<logn; i++){
        for(j=1; j<=n; j++){
            mxv[i][j] = max(mxv[i-1][j], mxv[i-1][j+(1<<(i-1))]);
            mnc[i][j] = min(mnc[i-1][j], mnc[i-1][j+(1<<(i-1))]);
        }
    }
}

int find(int x, int y)
{
    if(x>y)
        return 0;
    int i, j, ret;
    ret = mod;
    for(i=logn-1; i>=0; i--){
        if((x+(1<<i)-1)<=y){
            ret = min(ret, min(mxv[i][x], mnc[i][x]));
            x += (1<<i);
        }
    }
    return ret;
}

int find_cut(int x)
{
    int i, j;
    int r1 = v[x]*100;
    int r2 = c[x];
    for(i=logn-1; i>=0; i--){
        if(max(r1, mxv[i][x]) < min(r2, mnc[i][x])){
            r1 = max(r1, mxv[i][x]);
            r2 = min(r2, mnc[i][x]);
            x += (1<<i);
            x = min(x, n+1);
        }
    }
    x = min(x, n);
    return x;
}

double solve()
{
    int i, j;
    double ret = 0, prev, num, den;
    prev = (double)k/n;
    ret = prev*potential[1];
    num = n-k;
    den = n-1;
    for(i=2; i<=(n-k+1); i++){
        prev = (prev*(num/den));
        ret += (prev*potential[i]);
        num--;
        den--;
    }
    return ret;
}

int main()
{
    //freopen("i.txt", "r", stdin);
    //freopen("o.txt", "w", stdout);
    int i, j, cut;
    scanf("%d%d", &n, &k);
    for(i=1; i<=n; i++){
        scanf("%d", &v[i]);
        mxv[0][i] = v[i]*100;
    }
    for(i=1; i<=n; i++){
        scanf("%d", &c[i]);
        mnc[0][i] = c[i];
    }
    pre();
    for(i=1; i<=n; i++){
        cut = find_cut(i);
        potential[i] = max(find(i, cut), find(i, cut-1));
    }
    sort(potential+1, potential+n+1);
    double ans = solve();
    printf("%.10lf\n", ans);
    return 0;
}


#include <bits/stdc++.h>

#define sz(a) static_cast<int>(a.size())
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define mp make_pair

using namespace std;

typedef long long ll;
typedef long double ld;

const int rmax = 22;

vector<vector<int> > maxim, minim;

int getmax(int i, int l)
{
    if (l == 1) {
        return maxim[i][0];
    }
    int d = 0;
    for (; (1 << d) <= l; ++d) ;
    --d;
    return max(maxim[i][d], maxim[i + l - (1 << d)][d]);
}

int getmin(int i, int l)
{
    if (l == 1) {
        return minim[i][0];
    }
    int d = 0;
    for (; (1 << d) <= l; ++d) ;
    --d;
    return min(minim[i][d], minim[i + l - (1 << d)][d]);
}

int main()
{

    //freopen("input.txt", "r", stdin);

    int n, k;
    scanf("%d%d", &n, &k);

    vector<int> v(n), c(n);
    for (int i = 0; i < n; ++i) {
        scanf("%d", &v[i]);
    }
    for (int i = 0; i < n; ++i) {
        scanf("%d", &c[i]);
    }

    maxim.resize(n);
    minim.resize(n);
    for (int i = 0; i < n; ++i) {
        maxim[i].resize(rmax);
        minim[i].resize(rmax);
    }

    for (int i = n - 1; i >= 0; --i) {
        maxim[i][0] = v[i];
        minim[i][0] = c[i];
        for (int r = 1; r < rmax; ++r) {
            int t = i + (1 << (r - 1));
            if (t >= n) {
                maxim[i][r] = maxim[i][r - 1];
                minim[i][r] = minim[i][r - 1];
            } else {
                maxim[i][r] = max(maxim[i][r - 1], maxim[t][r - 1]);
                minim[i][r] = min(minim[i][r - 1], minim[t][r - 1]);
            }
        }
    }

    vector<int> a(n);
    for (int i = n - 1; i >= 0; --i) {
        int l = 1, r = n - i + 1;
        while (l < r - 1) {
            int m = (l + r) >> 1;
            int L = min(100 * getmax(i, m - 1), getmin(i, m - 1));
            int R = min(100 * getmax(i, m), getmin(i, m));
            if (L < R) {
                l = m;
            } else {
                r = m;
            }
        }
        a[i] = min(100 * getmax(i, l), getmin(i, l));
    }

    sort(all(a));

    ld ans = 0;
    ld C = (ld)(k) / (ld)(n);
    int t = n - 1;
    int s = k - 1;

    for (int i = 0; i <= n - k; ++i) {
        if (i) {
            C *= (t - s);
            C /= t;
            --t;
        }
        ans += C * (ld)(a[i]);
    }

    cout << fixed;
    cout.precision(10);
    cout << ans << "\n";

}


#include <bits/stdc++.h>

#define sz(a) static_cast<int>(a.size())
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define mp make_pair

using namespace std;

typedef long long ll;
typedef long double ld;

const int rmax = 22;

vector<vector<ll> > maxim, minim;

ll getmax(int i, int l)
{
    if (l == 1) {
        return maxim[i][0];
    }
    int d = 0;
    for (; (1 << d) <= l; ++d) ;
    --d;
    return max(maxim[i][d], maxim[i + l - (1 << d)][d]);
}

ll getmin(int i, int l)
{
    if (l == 1) {
        return minim[i][0];
    }
    int d = 0;
    for (; (1 << d) <= l; ++d) ;
    --d;
    return min(minim[i][d], minim[i + l - (1 << d)][d]);
}

int main()
{

    //ifstream cin("input.txt");

    int n, k;
    scanf("%d%d", &n, &k);

    vector<ll> v(n), c(n);
    for (int i = 0; i < n; ++i) {
        scanf("%I64d", &v[i]);
    }
    for (int i = 0; i < n; ++i) {
        scanf("%I64d", &c[i]);
    }

    maxim.resize(n);
    minim.resize(n);
    for (int i = 0; i < n; ++i) {
        maxim[i].resize(rmax);
        minim[i].resize(rmax);
    }

    for (int i = n - 1; i >= 0; --i) {
        maxim[i][0] = v[i];
        minim[i][0] = c[i];
        for (int r = 1; r < rmax; ++r) {
            int t = i + (1 << (r - 1));
            if (t >= n) {
                maxim[i][r] = maxim[i][r - 1];
                minim[i][r] = minim[i][r - 1];
            } else {
                maxim[i][r] = max(maxim[i][r - 1], maxim[t][r - 1]);
                minim[i][r] = min(minim[i][r - 1], minim[t][r - 1]);
            }
        }
    }

    vector<ll> a(n);
    for (int i = n - 1; i >= 0; --i) {
        int l = 1, r = n - i + 1;
        while (l < r - 1) {
            int m = (l + r) >> 1;
            ll L = min(100 * getmax(i, m - 1), getmin(i, m - 1));
            ll R = min(100 * getmax(i, m), getmin(i, m));
            if (L <= R) {
                l = m;
            } else {
                r = m;
            }
        }
        a[i] = min(100 * getmax(i, l), getmin(i, l));
    }
    sort(all(a));

    ld ans = 0;
    ld C = (ld)(k) / (ld)(n);
    int t = n - 1;
    int s = k - 1;

    for (int i = 0; i <= n - k; ++i) {
        if (i) {
            C /= t;
            C *= (t - s);
            --t;
        }
        ans += C * (ld)(a[i]);
    }

    cout << fixed;
    cout.precision(10);
    cout << ans << "\n";

}


#include <bits/stdc++.h>

#define sz(a) static_cast<int>(a.size())
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define mp make_pair

using namespace std;

typedef long long ll;
typedef long double ld;

const int rmax = 22;

vector<vector<int> > maxim, minim;

int getmax(int i, int l)
{
    if (l == 1) {
        return maxim[i][0];
    }
    int d = 0;
    for (; (1 << d) <= l; ++d) ;
    --d;
    return max(maxim[i][d], maxim[i + l - (1 << d)][d]);
}

int getmin(int i, int l)
{
    if (l == 1) {
        return minim[i][0];
    }
    int d = 0;
    for (; (1 << d) <= l; ++d) ;
    --d;
    return min(minim[i][d], minim[i + l - (1 << d)][d]);
}

int main()
{

    //freopen("input.txt", "r", stdin);

    int n, k;
    scanf("%d%d", &n, &k);

    vector<int> v(n), c(n);
    for (int i = 0; i < n; ++i) {
        scanf("%I64d", &v[i]);
    }
    for (int i = 0; i < n; ++i) {
        scanf("%I64d", &c[i]);
    }

    maxim.resize(n);
    minim.resize(n);
    for (int i = 0; i < n; ++i) {
        maxim[i].resize(rmax);
        minim[i].resize(rmax);
    }

    for (int i = n - 1; i >= 0; --i) {
        maxim[i][0] = v[i];
        minim[i][0] = c[i];
        for (int r = 1; r < rmax; ++r) {
            int t = i + (1 << (r - 1));
            if (t >= n) {
                maxim[i][r] = maxim[i][r - 1];
                minim[i][r] = minim[i][r - 1];
            } else {
                maxim[i][r] = max(maxim[i][r - 1], maxim[t][r - 1]);
                minim[i][r] = min(minim[i][r - 1], minim[t][r - 1]);
            }
        }
    }

    vector<int> a(n);
    for (int i = n - 1; i >= 0; --i) {
        int l = 1, r = n - i + 1;
        while (l < r - 1) {
            int m = (l + r) >> 1;
            int L = min(100 * getmax(i, m - 1), getmin(i, m - 1));
            int R = min(100 * getmax(i, m), getmin(i, m));
            if (L < R) {
                l = m;
            } else {
                r = m;
            }
        }
        a[i] = min(100 * getmax(i, l), getmin(i, l));
    }

    sort(all(a));

    ld ans = 0;
    ld C = (ld)(k) / (ld)(n);
    int t = n - 1;
    int s = k - 1;

    for (int i = 0; i <= n - k; ++i) {
        if (i) {
            C *= (t - s);
            C /= t;
            --t;
        }
        ans += C * (ld)(a[i]);
    }

    cout << fixed;
    cout.precision(10);
    cout << ans << "\n";

}


#include <bits/stdc++.h>

#define sz(a) static_cast<int>(a.size())
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define mp make_pair

using namespace std;

typedef long long ll;
typedef long double ld;

const int rmax = 22;

vector<vector<int> > maxim, minim;

int getmax(int i, int l)
{
    if (l == 1) {
        return maxim[i][0];
    }
    int d = 0;
    for (; (1 << d) <= l; ++d) ;
    --d;
    return max(maxim[i][d], maxim[i + l - (1 << d)][d]);
}

int getmin(int i, int l)
{
    if (l == 1) {
        return minim[i][0];
    }
    int d = 0;
    for (; (1 << d) <= l; ++d) ;
    --d;
    return min(minim[i][d], minim[i + l - (1 << d)][d]);
}

int main()
{

    //freopen("input.txt", "r", stdin);

    int n, k;
    scanf("%d%d", &n, &k);

    vector<int> v(n), c(n);
    for (int i = 0; i < n; ++i) {
        scanf("%d", &v[i]);
    }
    for (int i = 0; i < n; ++i) {
        scanf("%d", &c[i]);
    }

    maxim.resize(n);
    minim.resize(n);
    for (int i = 0; i < n; ++i) {
        maxim[i].resize(rmax);
        minim[i].resize(rmax);
    }

    for (int i = n - 1; i >= 0; --i) {
        maxim[i][0] = v[i];
        minim[i][0] = c[i];
        for (int r = 1; r < rmax; ++r) {
            int t = i + (1 << (r - 1));
            if (t >= n) {
                maxim[i][r] = maxim[i][r - 1];
                minim[i][r] = minim[i][r - 1];
            } else {
                maxim[i][r] = max(maxim[i][r - 1], maxim[t][r - 1]);
                minim[i][r] = min(minim[i][r - 1], minim[t][r - 1]);
            }
        }
    }

    vector<int> a(n);
    for (int i = n - 1; i >= 0; --i) {
        int l = 1, r = n - i;
        while (l < r) {
            int m = (l + r + 1) >> 1;
            //int L = min(100 * getmax(i, m - 1), getmin(i, m - 1));
            //int R = min(100 * getmax(i, m), getmin(i, m));
            if (100 * getmax(i, m) <= getmin(i, m)) {
                l = m;
            } else {
                r = m - 1;
            }
        }
        a[i] = min(100 * getmax(i, l), getmin(i, l));
    }

    sort(all(a));

    ld ans = 0;
    ld C = (ld)(k) / (ld)(n);
    int t = n - 1;
    int s = k - 1;

    for (int i = 0; i <= n - k; ++i) {
        if (i) {
            C *= (t - s);
            C /= t;
            --t;
        }
        ans += C * (ld)(a[i]);
    }

    cout << fixed;
    cout.precision(10);
    cout << ans << "\n";

}


#include <bits/stdc++.h>

#define sz(a) static_cast<int>(a.size())
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define mp make_pair

using namespace std;

typedef long long ll;
typedef long double ld;

const int rmax = 25;

vector<vector<int> > maxim, minim;

int getmax(int i, int l)
{
    if (l == 1) {
        return maxim[i][0];
    }
    int d = 0;
    for (; (1 << d) <= l; ++d) ;
    --d;
    return max(maxim[i][d], maxim[i + l - (1 << d)][d]);
}

int getmin(int i, int l)
{
    if (l == 1) {
        return minim[i][0];
    }
    int d = 0;
    for (; (1 << d) <= l; ++d) ;
    --d;
    return min(minim[i][d], minim[i + l - (1 << d)][d]);
}

int main()
{

    //freopen("input.txt", "r", stdin);

    int n, k;
    scanf("%d%d", &n, &k);

    vector<int> v(n), c(n);
    for (int i = 0; i < n; ++i) {
        scanf("%d", &v[i]);
    }
    for (int i = 0; i < n; ++i) {
        scanf("%d", &c[i]);
    }

    maxim.resize(n);
    minim.resize(n);
    for (int i = 0; i < n; ++i) {
        maxim[i].resize(rmax);
        minim[i].resize(rmax);
    }

    for (int i = n - 1; i >= 0; --i) {
        maxim[i][0] = v[i];
        minim[i][0] = c[i];
        for (int r = 1; r < rmax; ++r) {
            int t = i + (1 << (r - 1));
            if (t >= n) {
                maxim[i][r] = maxim[i][r - 1];
                minim[i][r] = minim[i][r - 1];
            } else {
                maxim[i][r] = max(maxim[i][r - 1], maxim[t][r - 1]);
                minim[i][r] = min(minim[i][r - 1], minim[t][r - 1]);
            }
        }
    }

    vector<int> a(n);
    for (int i = n - 1; i >= 0; --i) {
        int l = 1, r = n - i + 1;
        while (l < r - 1) {
            int m = (l + r) >> 1;
            int L = min(100 * getmax(i, m - 1), getmin(i, m - 1));
            int R = min(100 * getmax(i, m), getmin(i, m));
            if (L < R) {
                l = m;
            } else {
                r = m;
            }
        }
        a[i] = min(100 * getmax(i, l), getmin(i, l));
    }

    sort(all(a));

    ld ans = 0;
    ld C = (ld)(k) / (ld)(n);
    int t = n - 1;
    int s = k - 1;

    for (int i = 0; i <= n - k; ++i) {
        if (i) {
            C *= (t - s);
            C /= t;
            --t;
        }
        ans += C * (ld)(a[i]);
    }

    cout << fixed;
    cout.precision(10);
    cout << ans << "\n";

}


#include <bits/stdc++.h>

#define sz(a) static_cast<int>(a.size())
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define mp make_pair

using namespace std;

typedef long long ll;
typedef long double ld;

const int rmax = 22;

vector<vector<int> > maxim, minim;

int getmax(int i, int l)
{
    if (l == 1) {
        return maxim[i][0];
    }
    int d = 0;
    for (; (1 << d) <= l; ++d) ;
    --d;
    return max(maxim[i][d], maxim[i + l - (1 << d)][d]);
}

int getmin(int i, int l)
{
    if (l == 1) {
        return minim[i][0];
    }
    int d = 0;
    for (; (1 << d) <= l; ++d) ;
    --d;
    return min(minim[i][d], minim[i + l - (1 << d)][d]);
}

int main()
{

    //freopen("input.txt", "r", stdin);

    int n, k;
    scanf("%d%d", &n, &k);

    vector<int> v(n), c(n);
    for (int i = 0; i < n; ++i) {
        scanf("%d", &v[i]);
    }
    for (int i = 0; i < n; ++i) {
        scanf("%d", &c[i]);
    }

    maxim.resize(n);
    minim.resize(n);
    for (int i = 0; i < n; ++i) {
        maxim[i].resize(rmax);
        minim[i].resize(rmax);
    }

    for (int i = n - 1; i >= 0; --i) {
        maxim[i][0] = v[i];
        minim[i][0] = c[i];
        for (int r = 1; r < rmax; ++r) {
            int t = i + (1 << (r - 1));
            if (t >= n) {
                maxim[i][r] = maxim[i][r - 1];
                minim[i][r] = minim[i][r - 1];
            } else {
                maxim[i][r] = max(maxim[i][r - 1], maxim[t][r - 1]);
                minim[i][r] = min(minim[i][r - 1], minim[t][r - 1]);
            }
        }
    }

    vector<int> a(n);
    for (int i = n - 1; i >= 0; --i) {
        int l = 1, r = n - i;
        while (l < r) {
            int m = (l + r + 1) >> 1;
            //int L = min(100 * getmax(i, m - 1), getmin(i, m - 1));
            //int R = min(100 * getmax(i, m), getmin(i, m));
            if (100 * getmax(i, m) <= getmin(i, m)) {
                l = m;
            } else {
                r = m - 1;
            }
        }
        a[i] = min(100 * getmax(i, l), getmin(i, l));
        if (l != n - i) {
            a[i] = max(a[i], min(100 * getmax(i, l + 1), getmin(i, l + 1)));
        }
    }

    sort(all(a));

    ld ans = 0;
    ld C = (ld)(k) / (ld)(n);
    int t = n - 1;
    int s = k - 1;

    for (int i = 0; i <= n - k; ++i) {
        if (i) {
            C *= (t - s);
            C /= t;
            --t;
        }
        ans += C * (ld)(a[i]);
    }

    cout << fixed;
    cout.precision(10);
    cout << ans << "\n";

}


#include <bits/stdc++.h>

#define sz(a) static_cast<int>(a.size())
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define mp make_pair

using namespace std;

typedef long long ll;
typedef long double ld;

const int rmax = 22;

vector<vector<ll> > maxim, minim;

ll getmax(int i, int l)
{
    if (l == 1) {
        return maxim[i][0];
    }
    int d = 0;
    for (; (1 << d) <= l; ++d) ;
    --d;
    return max(maxim[i][d], maxim[i + l - (1 << d)][d]);
}

ll getmin(int i, int l)
{
    if (l == 1) {
        return minim[i][0];
    }
    int d = 0;
    for (; (1 << d) <= l; ++d) ;
    --d;
    return min(minim[i][d], minim[i + l - (1 << d)][d]);
}

int main()
{

    //ifstream cin("input.txt");

    int n, k;
    scanf("%d%d", &n, &k);

    vector<ll> v(n), c(n);
    for (int i = 0; i < n; ++i) {
        scanf("%I64d", &v[i]);
    }
    for (int i = 0; i < n; ++i) {
        scanf("%I64d", &c[i]);
    }

    maxim.resize(n);
    minim.resize(n);
    for (int i = 0; i < n; ++i) {
        maxim[i].resize(rmax);
        minim[i].resize(rmax);
    }

    for (int i = n - 1; i >= 0; --i) {
        maxim[i][0] = v[i];
        minim[i][0] = c[i];
        for (int r = 1; r < rmax; ++r) {
            int t = i + (1 << (r - 1));
            if (t >= n) {
                maxim[i][r] = maxim[i][r - 1];
                minim[i][r] = minim[i][r - 1];
            } else {
                maxim[i][r] = max(maxim[i][r - 1], maxim[t][r - 1]);
                minim[i][r] = min(minim[i][r - 1], minim[t][r - 1]);
            }
        }
    }

    vector<ll> a(n);
    for (int i = n - 1; i >= 0; --i) {
        int l = 1, r = n - i + 1;
        while (l < r - 1) {
            int m = (l + r) >> 1;
            ll L = min(100 * getmax(i, m - 1), getmin(i, m - 1));
            ll R = min(100 * getmax(i, m), getmin(i, m));
            if (L <= R) {
                l = m;
            } else {
                r = m;
            }
        }
        a[i] = min(100 * getmax(i, l), getmin(i, l));
    }
    sort(all(a));

    ld ans = 0;
    ld C = (ld)(k) / (ld)(n);
    int t = n - 1;
    int s = k - 1;

    for (int i = 0; i <= n - k; ++i) {
        if (i) {
            C *= (t - s);
            C /= t;
            --t;
        }
        ans += C * (ld)(a[i]);
    }

    cout << fixed;
    cout.precision(10);
    cout << ans << "\n";

}


#include <bits/stdc++.h>

#define sz(a) static_cast<int>(a.size())
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define mp make_pair

using namespace std;

typedef long long ll;
typedef long double ld;

const int rmax = 22;

vector<vector<int> > maxim, minim;

int getmax(int i, int l)
{
    if (l == 1) {
        return maxim[i][0];
    }
    int d = 0;
    for (; (1 << d) <= l; ++d) ;
    --d;
    return max(maxim[i][d], maxim[i + l - (1 << d)][d]);
}

int getmin(int i, int l)
{
    if (l == 1) {
        return minim[i][0];
    }
    int d = 0;
    for (; (1 << d) <= l; ++d) ;
    --d;
    return min(minim[i][d], minim[i + l - (1 << d)][d]);
}

int main()
{

    //freopen("input.txt", "r", stdin);

    int n, k;
    scanf("%d%d", &n, &k);

    vector<int> v(n), c(n);
    for (int i = 0; i < n; ++i) {
        scanf("%d", &v[i]);
    }
    for (int i = 0; i < n; ++i) {
        scanf("%d", &c[i]);
    }

    maxim.resize(n);
    minim.resize(n);
    for (int i = 0; i < n; ++i) {
        maxim[i].resize(rmax);
        minim[i].resize(rmax);
    }

    for (int i = n - 1; i >= 0; --i) {
        maxim[i][0] = v[i];
        minim[i][0] = c[i];
        for (int r = 1; r < rmax; ++r) {
            int t = i + (1 << (r - 1));
            if (t >= n) {
                maxim[i][r] = maxim[i][r - 1];
                minim[i][r] = minim[i][r - 1];
            } else {
                maxim[i][r] = max(maxim[i][r - 1], maxim[t][r - 1]);
                minim[i][r] = min(minim[i][r - 1], minim[t][r - 1]);
            }
        }
    }

    vector<int> a(n);
    for (int i = n - 1; i >= 0; --i) {
        int l = 1, r = n - i + 1;
        while (l < r - 1) {
            int m = (l + r) >> 1;
            //int L = min(100 * getmax(i, m - 1), getmin(i, m - 1));
            //int R = min(100 * getmax(i, m), getmin(i, m));
            if (100 * getmax(i, m) <= getmin(i, m)) {
                l = m;
            } else {
                r = m;
            }
        }
        a[i] = min(100 * getmax(i, l), getmin(i, l));
    }

    sort(all(a));

    ld ans = 0;
    ld C = (ld)(k) / (ld)(n);
    int t = n - 1;
    int s = k - 1;

    for (int i = 0; i <= n - k; ++i) {
        if (i) {
            C *= (t - s);
            C /= t;
            --t;
        }
        ans += C * (ld)(a[i]);
    }

    cout << fixed;
    cout.precision(10);
    cout << ans << "\n";

}


#include <bits/stdc++.h>

#define sz(a) static_cast<int>(a.size())
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define mp make_pair

using namespace std;

typedef long long ll;
typedef long double ld;

const int rmax = 22;

vector<vector<int> > maxim, minim;

int getmax(int i, int l)
{
    if (l == 1) {
        return maxim[i][0];
    }
    int d = 0;
    for (; (1 << d) <= l; ++d) ;
    --d;
    return max(maxim[i][d], maxim[i + l - (1 << d)][d]);
}

int getmin(int i, int l)
{
    if (l == 1) {
        return minim[i][0];
    }
    int d = 0;
    for (; (1 << d) <= l; ++d) ;
    --d;
    return min(minim[i][d], minim[i + l - (1 << d)][d]);
}

int main()
{

    //freopen("input.txt", "r", stdin);

    int n, k;
    scanf("%d%d", &n, &k);

    vector<int> v(n), c(n);
    for (int i = 0; i < n; ++i) {
        scanf("%d", &v[i]);
    }
    for (int i = 0; i < n; ++i) {
        scanf("%d", &c[i]);
    }

    maxim.resize(n);
    minim.resize(n);
    for (int i = 0; i < n; ++i) {
        maxim[i].resize(rmax);
        minim[i].resize(rmax);
    }

    for (int i = n - 1; i >= 0; --i) {
        maxim[i][0] = v[i];
        minim[i][0] = c[i];
        for (int r = 1; r < rmax; ++r) {
            int t = i + (1 << (r - 1));
            if (t >= n) {
                maxim[i][r] = maxim[i][r - 1];
                minim[i][r] = minim[i][r - 1];
            } else {
                maxim[i][r] = max(maxim[i][r - 1], maxim[t][r - 1]);
                minim[i][r] = min(minim[i][r - 1], minim[t][r - 1]);
            }
        }
    }

    vector<int> a(n);
    for (int i = n - 1; i >= 0; --i) {
        int l = 1, r = n - i + 1;
        while (l < r - 1) {
            int m = (l + r) >> 1;
            int L = min(100 * getmax(i, m - 1), getmin(i, m - 1));
            int R = min(100 * getmax(i, m), getmin(i, m));
            if (L < R) {
                l = m;
            } else {
                r = m;
            }
        }
        a[i] = min(100 * getmax(i, l), getmin(i, l));
    }

    sort(all(a));

    ld ans = 0;
    ld C = (ld)(k) / (ld)(n);
    int t = n - 1;
    int s = k - 1;

    for (int i = 0; i <= min(n - k, 100); ++i) {
        if (i) {
            C *= (t - s);
            C /= t;
            --t;
        }
        if (C >= 1e-20) {
            ans += C * (ld)(a[i]);
        } else {
            break;
        }
    }

    cout << fixed;
    cout.precision(10);
    cout << ans << "\n";

}


#include <bits/stdc++.h>

#define sz(a) static_cast<int>(a.size())
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define mp make_pair

using namespace std;

typedef long long ll;
typedef long double ld;

const int rmax = 22;

vector<vector<int> > maxim, minim;

int getmax(int i, int l)
{
    if (l == 1) {
        return maxim[i][0];
    }
    int d = 0;
    for (; (1 << d) <= l; ++d) ;
    --d;
    return max(maxim[i][d], maxim[i + l - (1 << d)][d]);
}

int getmin(int i, int l)
{
    if (l == 1) {
        return minim[i][0];
    }
    int d = 0;
    for (; (1 << d) <= l; ++d) ;
    --d;
    return min(minim[i][d], minim[i + l - (1 << d)][d]);
}

int main()
{

    //freopen("input.txt", "r", stdin);

    int n, k;
    scanf("%d%d", &n, &k);

    vector<int> v(n), c(n);
    for (int i = 0; i < n; ++i) {
        scanf("%d", &v[i]);
    }
    for (int i = 0; i < n; ++i) {
        scanf("%d", &c[i]);
    }

    maxim.resize(n);
    minim.resize(n);
    for (int i = 0; i < n; ++i) {
        maxim[i].resize(rmax);
        minim[i].resize(rmax);
    }

    for (int i = n - 1; i >= 0; --i) {
        maxim[i][0] = v[i];
        minim[i][0] = c[i];
        for (int r = 1; r < rmax; ++r) {
            int t = i + (1 << (r - 1));
            if (t >= n) {
                maxim[i][r] = maxim[i][r - 1];
                minim[i][r] = minim[i][r - 1];
            } else {
                maxim[i][r] = max(maxim[i][r - 1], maxim[t][r - 1]);
                minim[i][r] = min(minim[i][r - 1], minim[t][r - 1]);
            }
        }
    }

    vector<int> a(n);
    for (int i = n - 1; i >= 0; --i) {
        int l = 1, r = n - i + 1;
        while (l < r - 1) {
            int m = (l + r) >> 1;
            int L = min(100 * getmax(i, m - 1), getmin(i, m - 1));
            int R = min(100 * getmax(i, m), getmin(i, m));
            if (L < R) {
                l = m;
            } else {
                r = m;
            }
        }
        a[i] = min(100 * getmax(i, l), getmin(i, l));
    }

    sort(all(a));

    ld ans = 0;
    ld C = (ld)(k) / (ld)(n);
    int t = n - 1;
    int s = k - 1;

    for (int i = 0; i <= n - k; ++i) {
        if (i) {
            C *= (t - s);
            C /= t;
            --t;
        }
        if (C >= 1e-20) {
            ans += C * (ld)(a[i]);
        } else {
            break;
        }
    }

    cout << fixed;
    cout.precision(10);
    cout << ans << "\n";

}


#include <bits/stdc++.h>

#define sz(a) static_cast<int>(a.size())
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define mp make_pair

using namespace std;

typedef long long ll;
typedef long double ld;

const int rmax = 22;

vector<vector<ll> > maxim, minim;

ll getmax(int i, int l)
{
    if (l == 1) {
        return maxim[i][0];
    }
    int d = 0;
    for (; (1 << d) <= l; ++d) ;
    --d;
    return max(maxim[i][d], maxim[i + l - (1 << d)][d]);
}

ll getmin(int i, int l)
{
    if (l == 1) {
        return minim[i][0];
    }
    int d = 0;
    for (; (1 << d) <= l; ++d) ;
    --d;
    return min(minim[i][d], minim[i + l - (1 << d)][d]);
}

int main()
{

    //freopen("input.txt", "r", stdin);

    int n, k;
    scanf("%d%d", &n, &k);

    vector<ll> v(n), c(n);
    for (int i = 0; i < n; ++i) {
        scanf("%I64d", &v[i]);
    }
    for (int i = 0; i < n; ++i) {
        scanf("%I64d", &c[i]);
    }

    maxim.resize(n);
    minim.resize(n);
    for (int i = 0; i < n; ++i) {
        maxim[i].resize(rmax);
        minim[i].resize(rmax);
    }

    for (int i = n - 1; i >= 0; --i) {
        maxim[i][0] = v[i];
        minim[i][0] = c[i];
        for (int r = 1; r < rmax; ++r) {
            int t = i + (1 << (r - 1));
            if (t >= n) {
                maxim[i][r] = maxim[i][r - 1];
                minim[i][r] = minim[i][r - 1];
            } else {
                maxim[i][r] = max(maxim[i][r - 1], maxim[t][r - 1]);
                minim[i][r] = min(minim[i][r - 1], minim[t][r - 1]);
            }
        }
    }

    vector<ll> a(n);
    /*for (int i = n - 1; i >= 0; --i) {
        a[i] = -1;
        for (int l = 1; l <= n - i; ++l) {
            a[i] = max(a[i], min(100 * getmax(i, l), getmin(i, l)));
        }
    }*/
    for (int i = n - 1; i >= 0; --i) {
        int l = 1, r = n - i + 1;
        while (l < r - 1) {
            int m = (l + r) >> 1;
            ll L = min(100 * getmax(i, m - 1), getmin(i, m - 1));
            ll R = min(100 * getmax(i, m), getmin(i, m));
            if (L < R) {
                l = m;
            } else {
                r = m;
            }
        }
        a[i] = min(100 * getmax(i, l), getmin(i, l));
    }
    //cout << "\n";
    sort(all(a));
    /*for (int i = 0; i < n; ++i) {
        cout << a[i] << " ";
    }*/

    ld ans = 0;
    ld C = (ld)(k) / (ld)(n);
    int t = n - 1;
    int s = k - 1;

    for (int i = 0; i <= n - k; ++i) {
        if (i) {
            C *= (t - s);
            C /= t;
            --t;
        }
        ans += C * (ld)(a[i]);
    }

    cout << fixed;
    cout.precision(10);
    cout << ans << "\n";

}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
using namespace std;

#define N 2000030
#define ls (i << 1)
#define rs (ls | 1)
#define md (ll + rr >> 1)
#define lson ll, md, ls
#define rson md + 1, rr, rs
#define LL long long
#define pii pair<int, int>
#define mp make_pair
#define fi first
#define se second

int s1[N], s2[N];
int san[N], cnt;
int v[N], c[N];
int n, k;
LL mx[N << 1];
int ans[N];
double p[N];
double f[N];

double fac[N];

double C(int x, int y) {
	return fac[x] - fac[y] - fac[x-y];
}

void build(int ll, int rr, int i) {
	if(ll == rr) {
		mx[i] = min(v[ll], c[ll]);
		return;
	}
	build(lson);
	build(rson);
}

int bit_query1(int x) {
	int ret = 0;
	while(x <= cnt) {
		ret = max(ret, s1[x]);
		x += x & -x;
	}
	return ret;
}
int bit_upd1(int x, int v) {
	while(x) {
		s1[x] = max(s1[x], v);
		x -= x & -x;
	}
}
int bit_query2(int x) {
	int ret = 0;
	while(x) {
		ret = max(ret, s2[x]);
		x -= x & -x;
	}
	return ret;
}
int bit_upd2(int x, int v) {
	while(x <= cnt) {
		s2[x] = max(s2[x], v);
		x += x & -x;
	}
}

void update(int l, int r, LL v, int ll, int rr, int i) {
	if(ll == l && rr == r) {
		mx[i] = max(mx[i], v);
		return;
	}
	if(r <= md) update(l, r, v, lson);
	else if(l > md) update(l, r, v, rson);
	else {
		update(l, md, v, lson);
		update(md + 1, r, v, rson);
	}
}
int haxi(LL x) {
	return lower_bound(san + 1, san + cnt + 1, x) - san;
}

void get_ans(LL pre, int ll, int rr, int i) {
	if(ll == rr) {
		ans[ll] = max(mx[i], pre);
		return;
	}
	get_ans(max(pre, mx[i]), lson);
	get_ans(max(pre, mx[i]), rson);
}

int main() {

	for(int i = 1; i < N; ++i) f[i] = log(i * 1.0);
	for(int i = 1; i < N; ++i) fac[i] = fac[i-1] + log(i * 1.0);
	scanf("%d%d", &n, &k);
	for(int i = 1; i <= n; ++i) scanf("%d", &v[i]), v[i] *= 100;
	for(int i = 1; i <= n; ++i) scanf("%d", &c[i]);

	for(int i = n; i >= 1; --i) {
		ans[i] = min(max(ans[i+1], v[i]), c[i]);
	}

	double x = 0;
	double res = 0;

	sort(ans + 1, ans + n + 1);

	for(int i = 1; i <= n - k + 1; ++i) {
		res += exp(C(n - i, k - 1) - C(n, k)) * ans[i];
	}

	printf("%.12lf\n", (double) res);
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
using namespace std;

#define N 2000030
#define ls (i << 1)
#define rs (ls | 1)
#define md (ll + rr >> 1)
#define lson ll, md, ls
#define rson md + 1, rr, rs
#define LL long long
#define pii pair<int, int>
#define mp make_pair
#define fi first
#define se second

int s1[N], s2[N];
int san[N], cnt;
LL v[N], c[N];
int n, k;
LL mx[N << 1];
LL ans[N];
double p[N];
double f[N];

double fac[N];

double C(int x, int y) {
	return fac[x] - fac[y] - fac[x-y];
}

void build(int ll, int rr, int i) {
	if(ll == rr) {
		mx[i] = min(v[ll], c[ll]);
		return;
	}
	build(lson);
	build(rson);
}

int bit_query1(int x) {
	int ret = 0;
	while(x <= cnt) {
		ret = max(ret, s1[x]);
		x += x & -x;
	}
	return ret;
}
int bit_upd1(int x, int v) {
	while(x) {
		s1[x] = max(s1[x], v);
		x -= x & -x;
	}
}
int bit_query2(int x) {
	int ret = 0;
	while(x) {
		ret = max(ret, s2[x]);
		x -= x & -x;
	}
	return ret;
}
int bit_upd2(int x, int v) {
	while(x <= cnt) {
		s2[x] = max(s2[x], v);
		x += x & -x;
	}
}

void update(int l, int r, LL v, int ll, int rr, int i) {
	if(ll == l && rr == r) {
		mx[i] = max(mx[i], v);
		return;
	}
	if(r <= md) update(l, r, v, lson);
	else if(l > md) update(l, r, v, rson);
	else {
		update(l, md, v, lson);
		update(md + 1, r, v, rson);
	}
}
int haxi(LL x) {
	return lower_bound(san + 1, san + cnt + 1, x) - san;
}

void get_ans(LL pre, int ll, int rr, int i) {
	if(ll == rr) {
		ans[ll] = max(mx[i], pre);
		return;
	}
	get_ans(max(pre, mx[i]), lson);
	get_ans(max(pre, mx[i]), rson);
}

int main() {

	for(int i = 1; i < N; ++i) f[i] = log(i * 1.0);
	for(int i = 1; i < N; ++i) fac[i] = fac[i-1] + log(i * 1.0);
	scanf("%d%d", &n, &k);
	for(int i = 1; i <= n; ++i) scanf("%I64d", &v[i]), v[i] *= 100, san[++cnt] = v[i];
	for(int i = 1; i <= n; ++i) scanf("%I64d", &c[i]), san[++cnt] = c[i];
	sort(san + 1, san + cnt + 1);
	cnt = unique(san + 1, san + cnt + 1) - san - 1;
	build(1, n, 1);

	for(int i = 1; i <= n; ++i) {
		bit_upd2(haxi(c[i]), i);
		int p = haxi(v[i]);
		int x = bit_query1(p);
		int y = bit_query2(p);
		x = max(x, y);
		if(x < i) update(x + 1, i, v[i], 1, n, 1);
		bit_upd1(p, i);
	}
	get_ans(0, 1, n, 1);

	double x = 0;
	double res = 0;

	sort(ans + 1, ans + n + 1);
	double tmp = k * 1.0 / n;

	for(int i = 0; i < k; ++i) {
		res += tmp * ans[i+1];
		if(n - i - 1 == 0) break;
		tmp *= n - k - i;
		tmp /= n - i - 1;
	}

	printf("%.12lf\n", (double) res);
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
using namespace std;

#define N 2000030
#define ls (i << 1)
#define rs (ls | 1)
#define md (ll + rr >> 1)
#define lson ll, md, ls
#define rson md + 1, rr, rs
#define LL long long
#define pii pair<int, int>
#define mp make_pair
#define fi first
#define se second

int s1[N], s2[N];
int san[N], cnt;
LL v[N], c[N];
int n, k;
LL mx[N << 1];
LL ans[N];
long double p[N];

void build(int ll, int rr, int i) {
	if(ll == rr) {
		mx[i] = min(v[ll], c[ll]);
		return;
	}
	build(lson);
	build(rson);
}

int bit_query1(int x) {
	int ret = 0;
	while(x <= cnt) {
		ret = max(ret, s1[x]);
		x += x & -x;
	}
	return ret;
}
int bit_upd1(int x, int v) {
	while(x) {
		s1[x] = max(s1[x], v);
		x -= x & -x;
	}
}
int bit_query2(int x) {
	int ret = 0;
	while(x) {
		ret = max(ret, s2[x]);
		x -= x & -x;
	}
	return ret;
}
int bit_upd2(int x, int v) {
	while(x <= cnt) {
		s2[x] = max(s2[x], v);
		x += x & -x;
	}
}

void update(int l, int r, LL v, int ll, int rr, int i) {
	if(ll == l && rr == r) {
		mx[i] = max(mx[i], v);
		return;
	}
	if(r <= md) update(l, r, v, lson);
	else if(l > md) update(l, r, v, rson);
	else {
		update(l, md, v, lson);
		update(md + 1, r, v, rson);
	}
}
int haxi(LL x) {
	return lower_bound(san + 1, san + cnt + 1, x) - san;
}

void get_ans(LL pre, int ll, int rr, int i) {
	if(ll == rr) {
		ans[ll] = max(mx[i], pre);
		return;
	}
	get_ans(max(pre, mx[i]), lson);
	get_ans(max(pre, mx[i]), rson);
}

int main() {

	scanf("%d%d", &n, &k);
	for(int i = 1; i <= n; ++i) scanf("%I64d", &v[i]), v[i] *= 100, san[++cnt] = v[i];
	for(int i = 1; i <= n; ++i) scanf("%I64d", &c[i]), san[++cnt] = c[i];
	sort(san + 1, san + cnt + 1);
	cnt = unique(san + 1, san + cnt + 1) - san - 1;
	build(1, n, 1);

	for(int i = 1; i <= n; ++i) {
		bit_upd2(haxi(c[i]), i);
		int p = haxi(v[i]);
		int x = bit_query1(p);
		int y = bit_query2(p);
		x = max(x, y);
		if(x < i) update(x + 1, i, v[i], 1, n, 1);
		bit_upd1(p, i);
	}
	get_ans(0, 1, n, 1);

	long double x = 1;
	long double res = 0;

	sort(ans + 1, ans + n + 1);
	for(int i = 1; i <= n - k + 1; ++i) {
		p[i] = x;
		x /= (n - i + 1);
		x *= n - i - k + 1;

	}
	for(int i = 1; i <= n - k + 1; ++i) {
		res += (p[i] - p[i+1]) * ans[i];
	}
	printf("%.12lf\n", (double) res);
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
using namespace std;

#define N 2000030
#define ls (i << 1)
#define rs (ls | 1)
#define md (ll + rr >> 1)
#define lson ll, md, ls
#define rson md + 1, rr, rs
#define LL long long
#define pii pair<int, int>
#define mp make_pair
#define fi first
#define se second

int s1[N], s2[N];
int san[N], cnt;
LL v[N], c[N];
int n, k;
LL mx[N << 1];
LL ans[N];
long double p[N];

void build(int ll, int rr, int i) {
	if(ll == rr) {
		mx[i] = min(v[ll], c[ll]);
		return;
	}
	build(lson);
	build(rson);
}

int bit_query1(int x) {
	int ret = 0;
	while(x <= cnt) {
		ret = max(ret, s1[x]);
		x += x & -x;
	}
	return ret;
}
int bit_upd1(int x, int v) {
	while(x) {
		s1[x] = max(s1[x], v);
		x -= x & -x;
	}
}
int bit_query2(int x) {
	int ret = 0;
	while(x) {
		ret = max(ret, s2[x]);
		x -= x & -x;
	}
	return ret;
}
int bit_upd2(int x, int v) {
	while(x <= cnt) {
		s2[x] = max(s2[x], v);
		x += x & -x;
	}
}

void update(int l, int r, LL v, int ll, int rr, int i) {
	if(ll == l && rr == r) {
		mx[i] = max(mx[i], v);
		return;
	}
	if(r <= md) update(l, r, v, lson);
	else if(l > md) update(l, r, v, rson);
	else {
		update(l, md, v, lson);
		update(md + 1, r, v, rson);
	}
}
int haxi(LL x) {
	return lower_bound(san + 1, san + cnt + 1, x) - san;
}

void get_ans(LL pre, int ll, int rr, int i) {
	if(ll == rr) {
		ans[ll] = max(mx[i], pre);
		return;
	}
	get_ans(max(pre, mx[i]), lson);
	get_ans(max(pre, mx[i]), rson);
}

int main() {

	scanf("%d%d", &n, &k);
	for(int i = 1; i <= n; ++i) scanf("%I64d", &v[i]), v[i] *= 100, san[++cnt] = v[i];
	for(int i = 1; i <= n; ++i) scanf("%I64d", &c[i]), san[++cnt] = c[i];
	sort(san + 1, san + cnt + 1);
	cnt = unique(san + 1, san + cnt + 1) - san - 1;
	build(1, n, 1);

	for(int i = 1; i <= n; ++i) {
		bit_upd2(haxi(c[i]), i);
		int p = haxi(v[i]);
		int x = bit_query1(p);
		int y = bit_query2(p);
		x = max(x, y);
		if(x < i) update(x + 1, i, v[i], 1, n, 1);
		bit_upd1(p, i);
	}
	get_ans(0, 1, n, 1);

	long double x = 1;
	long double res = 0;

	sort(ans + 1, ans + n + 1);
	for(int i = 1; i <= n - k + 1; ++i) {
		p[i] = x;
		x *= n - i - k + 1;
		x /= (n - i + 1);

	}
	for(int i = 1; i <= n - k + 1; ++i) {
		res += (p[i] - p[i+1]) * ans[i];
	}
	printf("%.12lf\n", (double) res);
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
using namespace std;

#define N 2000030
#define ls (i << 1)
#define rs (ls | 1)
#define md (ll + rr >> 1)
#define lson ll, md, ls
#define rson md + 1, rr, rs
#define LL long long
#define pii pair<int, int>
#define mp make_pair
#define fi first
#define se second

int s1[N], s2[N];
int san[N], cnt;
LL v[N], c[N];
int n, k;
LL mx[N << 1];
LL ans[N];
long double p[N];
long double f[N];

long double fac[N];

double C(int x, int y) {
	return fac[x] - fac[y] - fac[x-y];
}

void build(int ll, int rr, int i) {
	if(ll == rr) {
		mx[i] = min(v[ll], c[ll]);
		return;
	}
	build(lson);
	build(rson);
}

int bit_query1(int x) {
	int ret = 0;
	while(x <= cnt) {
		ret = max(ret, s1[x]);
		x += x & -x;
	}
	return ret;
}
int bit_upd1(int x, int v) {
	while(x) {
		s1[x] = max(s1[x], v);
		x -= x & -x;
	}
}
int bit_query2(int x) {
	int ret = 0;
	while(x) {
		ret = max(ret, s2[x]);
		x -= x & -x;
	}
	return ret;
}
int bit_upd2(int x, int v) {
	while(x <= cnt) {
		s2[x] = max(s2[x], v);
		x += x & -x;
	}
}

void update(int l, int r, LL v, int ll, int rr, int i) {
	if(ll == l && rr == r) {
		mx[i] = max(mx[i], v);
		return;
	}
	if(r <= md) update(l, r, v, lson);
	else if(l > md) update(l, r, v, rson);
	else {
		update(l, md, v, lson);
		update(md + 1, r, v, rson);
	}
}
int haxi(LL x) {
	return lower_bound(san + 1, san + cnt + 1, x) - san;
}

void get_ans(LL pre, int ll, int rr, int i) {
	if(ll == rr) {
		ans[ll] = max(mx[i], pre);
		return;
	}
	get_ans(max(pre, mx[i]), lson);
	get_ans(max(pre, mx[i]), rson);
}

int main() {

	for(int i = 1; i < N; ++i) f[i] = log(i * 1.0);
	for(int i = 1; i < N; ++i) fac[i] = fac[i-1] + log(i * 1.0);
	scanf("%d%d", &n, &k);
	for(int i = 1; i <= n; ++i) scanf("%I64d", &v[i]), v[i] *= 100, san[++cnt] = v[i];
	for(int i = 1; i <= n; ++i) scanf("%I64d", &c[i]), san[++cnt] = c[i];
	sort(san + 1, san + cnt + 1);
	cnt = unique(san + 1, san + cnt + 1) - san - 1;
	build(1, n, 1);

	for(int i = 1; i <= n; ++i) {
		bit_upd2(haxi(c[i]), i);
		int p = haxi(v[i]);
		int x = bit_query1(p);
		int y = bit_query2(p);
		x = max(x, y);
		if(x < i) update(x + 1, i, v[i], 1, n, 1);
		bit_upd1(p, i);
	}
	get_ans(0, 1, n, 1);

	long double x = 0;
	long double res = 0;

	sort(ans + 1, ans + n + 1);
	for(int i = 1; i <= n - k + 1; ++i) {
		p[i] = exp(C(n - i, k - 1) - C(n, k));

	}
	for(int i = 1; i <= n - k + 1; ++i) {
		res += p[i] * ans[i];
	}
	printf("%.12lf\n", (double) res);
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
using namespace std;

#define N 2000030
#define ls (i << 1)
#define rs (ls | 1)
#define md (ll + rr >> 1)
#define lson ll, md, ls
#define rson md + 1, rr, rs
#define LL long long
#define pii pair<int, int>
#define mp make_pair
#define fi first
#define se second

int s1[N], s2[N];
int san[N], cnt;
LL v[N], c[N];
int n, k;
LL mx[N << 1];
LL ans[N];
double p[N];
double f[N];

double fac[N];

double C(int x, int y) {
	return fac[x] - fac[y] - fac[x-y];
}

void build(int ll, int rr, int i) {
	if(ll == rr) {
		mx[i] = min(v[ll], c[ll]);
		return;
	}
	build(lson);
	build(rson);
}

int bit_query1(int x) {
	int ret = 0;
	while(x <= cnt) {
		ret = max(ret, s1[x]);
		x += x & -x;
	}
	return ret;
}
int bit_upd1(int x, int v) {
	while(x) {
		s1[x] = max(s1[x], v);
		x -= x & -x;
	}
}
int bit_query2(int x) {
	int ret = 0;
	while(x) {
		ret = max(ret, s2[x]);
		x -= x & -x;
	}
	return ret;
}
int bit_upd2(int x, int v) {
	while(x <= cnt) {
		s2[x] = max(s2[x], v);
		x += x & -x;
	}
}

void update(int l, int r, LL v, int ll, int rr, int i) {
	if(ll == l && rr == r) {
		mx[i] = max(mx[i], v);
		return;
	}
	if(r <= md) update(l, r, v, lson);
	else if(l > md) update(l, r, v, rson);
	else {
		update(l, md, v, lson);
		update(md + 1, r, v, rson);
	}
}
int haxi(LL x) {
	return lower_bound(san + 1, san + cnt + 1, x) - san;
}

void get_ans(LL pre, int ll, int rr, int i) {
	if(ll == rr) {
		ans[ll] = max(mx[i], pre);
		return;
	}
	get_ans(max(pre, mx[i]), lson);
	get_ans(max(pre, mx[i]), rson);
}

int main() {

	for(int i = 1; i < N; ++i) f[i] = log(i * 1.0);
	for(int i = 1; i < N; ++i) fac[i] = fac[i-1] + log(i * 1.0);
	scanf("%d%d", &n, &k);
	for(int i = 1; i <= n; ++i) scanf("%I64d", &v[i]), v[i] *= 100, san[++cnt] = v[i];
	for(int i = 1; i <= n; ++i) scanf("%I64d", &c[i]), san[++cnt] = c[i];
	sort(san + 1, san + cnt + 1);
	cnt = unique(san + 1, san + cnt + 1) - san - 1;
	build(1, n, 1);

	for(int i = 1; i <= n; ++i) {
		int pp = haxi(c[i]);
		int x = bit_query1(pp);
		if(v[i] >= c[i]) x = i;
		int y = bit_query2(pp);
		if(y < x) update(y + 1, x, c[i], 1, n, 1);
		bit_upd2(pp, i);
		int p = haxi(v[i]);
		x = bit_query1(p);
		y = bit_query2(p);
		x = max(x, y);
		if(x < i) update(x + 1, i, v[i], 1, n, 1);
		bit_upd1(p, i);
	}
	get_ans(0, 1, n, 1);

	double x = 0;
	double res = 0;

	sort(ans + 1, ans + n + 1);
	double tmp = k * 1.0 / n;

	for(int i = 0; i < k; ++i) {
		res += tmp * ans[i+1];
		if(n - i - 1 == 0) break;
		tmp *= n - k - i;
		tmp /= n - i - 1;
	}

	printf("%.12lf\n", (double) res);
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
using namespace std;

#define N 2000030
#define ls (i << 1)
#define rs (ls | 1)
#define md (ll + rr >> 1)
#define lson ll, md, ls
#define rson md + 1, rr, rs
#define LL long long
#define pii pair<int, int>
#define mp make_pair
#define fi first
#define se second

int s1[N], s2[N];
int san[N], cnt;
LL v[N], c[N];
int n, k;
LL mx[N << 1];
LL ans[N];
double p[N];
double f[N];

double fac[N];

double C(int x, int y) {
	return fac[x] - fac[y] - fac[x-y];
}

void build(int ll, int rr, int i) {
	if(ll == rr) {
		mx[i] = min(v[ll], c[ll]);
		return;
	}
	build(lson);
	build(rson);
}

int bit_query1(int x) {
	int ret = 0;
	while(x <= cnt) {
		ret = max(ret, s1[x]);
		x += x & -x;
	}
	return ret;
}
int bit_upd1(int x, int v) {
	while(x) {
		s1[x] = max(s1[x], v);
		x -= x & -x;
	}
}
int bit_query2(int x) {
	int ret = 0;
	while(x) {
		ret = max(ret, s2[x]);
		x -= x & -x;
	}
	return ret;
}
int bit_upd2(int x, int v) {
	while(x <= cnt) {
		s2[x] = max(s2[x], v);
		x += x & -x;
	}
}

void update(int l, int r, LL v, int ll, int rr, int i) {
	if(ll == l && rr == r) {
		mx[i] = max(mx[i], v);
		return;
	}
	if(r <= md) update(l, r, v, lson);
	else if(l > md) update(l, r, v, rson);
	else {
		update(l, md, v, lson);
		update(md + 1, r, v, rson);
	}
}
int haxi(LL x) {
	return lower_bound(san + 1, san + cnt + 1, x) - san;
}

void get_ans(LL pre, int ll, int rr, int i) {
	if(ll == rr) {
		ans[ll] = max(mx[i], pre);
		return;
	}
	get_ans(max(pre, mx[i]), lson);
	get_ans(max(pre, mx[i]), rson);
}

int main() {

	for(int i = 1; i < N; ++i) f[i] = log(i * 1.0);
	for(int i = 1; i < N; ++i) fac[i] = fac[i-1] + log(i * 1.0);
	scanf("%d%d", &n, &k);
	for(int i = 1; i <= n; ++i) scanf("%I64d", &v[i]), v[i] *= 100, san[++cnt] = v[i];
	for(int i = 1; i <= n; ++i) scanf("%I64d", &c[i]), san[++cnt] = c[i];
	sort(san + 1, san + cnt + 1);
	cnt = unique(san + 1, san + cnt + 1) - san - 1;
	build(1, n, 1);

	for(int i = 1; i <= n; ++i) {
		bit_upd2(haxi(c[i]), i);
		int p = haxi(v[i]);
		int x = bit_query1(p);
		int y = bit_query2(p);
		x = max(x, y);
		if(x < i) update(x + 1, i, v[i], 1, n, 1);
		bit_upd1(p, i);
	}
	get_ans(0, 1, n, 1);

	double x = 0;
	double res = 0;

	sort(ans + 1, ans + n + 1);
	for(int i = 1; i <= n - k + 1; ++i) {
		p[i] = exp(C(n - i, k - 1) - C(n, k));

	}
	for(int i = 1; i <= n - k + 1; ++i) {
		res += p[i] * ans[i];
	}
	printf("%.12lf\n", (double) res);
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
using namespace std;

#define N 2000030
#define ls (i << 1)
#define rs (ls | 1)
#define md (ll + rr >> 1)
#define lson ll, md, ls
#define rson md + 1, rr, rs
#define LL long long
#define pii pair<int, int>
#define mp make_pair
#define fi first
#define se second

int s1[N], s2[N];
int san[N], cnt;
int v[N], c[N];
int n, k;
LL mx[N << 1];
int ans[N];
double p[N];
double f[N];

double fac[N];

double C(int x, int y) {
	return fac[x] - fac[y] - fac[x-y];
}

void build(int ll, int rr, int i) {
	if(ll == rr) {
		mx[i] = min(v[ll], c[ll]);
		return;
	}
	build(lson);
	build(rson);
}

int bit_query1(int x) {
	int ret = 0;
	while(x <= cnt) {
		ret = max(ret, s1[x]);
		x += x & -x;
	}
	return ret;
}
int bit_upd1(int x, int v) {
	while(x) {
		s1[x] = max(s1[x], v);
		x -= x & -x;
	}
}
int bit_query2(int x) {
	int ret = 0;
	while(x) {
		ret = max(ret, s2[x]);
		x -= x & -x;
	}
	return ret;
}
int bit_upd2(int x, int v) {
	while(x <= cnt) {
		s2[x] = max(s2[x], v);
		x += x & -x;
	}
}

void update(int l, int r, LL v, int ll, int rr, int i) {
	if(ll == l && rr == r) {
		mx[i] = max(mx[i], v);
		return;
	}
	if(r <= md) update(l, r, v, lson);
	else if(l > md) update(l, r, v, rson);
	else {
		update(l, md, v, lson);
		update(md + 1, r, v, rson);
	}
}
int haxi(LL x) {
	return lower_bound(san + 1, san + cnt + 1, x) - san;
}

void get_ans(LL pre, int ll, int rr, int i) {
	if(ll == rr) {
		ans[ll] = max(mx[i], pre);
		return;
	}
	get_ans(max(pre, mx[i]), lson);
	get_ans(max(pre, mx[i]), rson);
}

int main() {

	for(int i = 1; i < N; ++i) f[i] = log(i * 1.0);
	for(int i = 1; i < N; ++i) fac[i] = fac[i-1] + log(i * 1.0);
	scanf("%d%d", &n, &k);
	for(int i = 1; i <= n; ++i) scanf("%d", &v[i]), v[i] *= 100;
	for(int i = 1; i <= n; ++i) scanf("%d", &c[i]);

	for(int i = n; i >= 1; --i) {
		ans[i] = min(max(ans[i+1], v[i]), c[i]);
	}

	double x = 0;
	double res = 0;

	sort(ans + 1, ans + n + 1);
	double tmp = k * 1.0 / n;

	for(int i = 0; i < k; ++i) {
		res += tmp * ans[i+1];
		if(n - i - 1 == 0) break;
		tmp *= n - k - i;
		tmp /= n - i - 1;
	}

	printf("%.12lf\n", (double) res);
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
using namespace std;

#define N 2000030
#define ls (i << 1)
#define rs (ls | 1)
#define md (ll + rr >> 1)
#define lson ll, md, ls
#define rson md + 1, rr, rs
#define LL long long
#define pii pair<int, int>
#define mp make_pair
#define fi first
#define se second

int s1[N], s2[N];
int san[N], cnt;
LL v[N], c[N];
int n, k;
LL mx[N << 1];
LL ans[N];
double p[N];
double f[N];

double fac[N];

double C(int x, int y) {
	return fac[x] - fac[y] - fac[x-y];
}

void build(int ll, int rr, int i) {
	if(ll == rr) {
		mx[i] = min(v[ll], c[ll]);
		return;
	}
	build(lson);
	build(rson);
}

int bit_query1(int x) {
	int ret = 0;
	while(x <= cnt) {
		ret = max(ret, s1[x]);
		x += x & -x;
	}
	return ret;
}
int bit_upd1(int x, int v) {
	while(x) {
		s1[x] = max(s1[x], v);
		x -= x & -x;
	}
}
int bit_query2(int x) {
	int ret = 0;
	while(x) {
		ret = max(ret, s2[x]);
		x -= x & -x;
	}
	return ret;
}
int bit_upd2(int x, int v) {
	while(x <= cnt) {
		s2[x] = max(s2[x], v);
		x += x & -x;
	}
}

void update(int l, int r, LL v, int ll, int rr, int i) {
	if(ll == l && rr == r) {
		mx[i] = max(mx[i], v);
		return;
	}
	if(r <= md) update(l, r, v, lson);
	else if(l > md) update(l, r, v, rson);
	else {
		update(l, md, v, lson);
		update(md + 1, r, v, rson);
	}
}
int haxi(LL x) {
	return lower_bound(san + 1, san + cnt + 1, x) - san;
}

void get_ans(LL pre, int ll, int rr, int i) {
	if(ll == rr) {
		ans[ll] = max(mx[i], pre);
		return;
	}
	get_ans(max(pre, mx[i]), lson);
	get_ans(max(pre, mx[i]), rson);
}

int main() {

	for(int i = 1; i < N; ++i) f[i] = log(i * 1.0);
	for(int i = 1; i < N; ++i) fac[i] = fac[i-1] + log(i * 1.0);
	scanf("%d%d", &n, &k);
	for(int i = 1; i <= n; ++i) scanf("%I64d", &v[i]), v[i] *= 100, san[++cnt] = v[i];
	for(int i = 1; i <= n; ++i) scanf("%I64d", &c[i]), san[++cnt] = c[i];
	sort(san + 1, san + cnt + 1);
	cnt = unique(san + 1, san + cnt + 1) - san - 1;
	build(1, n, 1);

	for(int i = 1; i <= n; ++i) {
		int pp = haxi(c[i]);
		int x = bit_query1(pp);
		int y = bit_query2(pp);
		if(y < x) update(y + 1, x, c[i], 1, n, 1);
		bit_upd2(pp, i);
		int p = haxi(v[i]);
		x = bit_query1(p);
		y = bit_query2(p);
		x = max(x, y);
		if(x < i) update(x + 1, i, v[i], 1, n, 1);
		bit_upd1(p, i);
	}
	get_ans(0, 1, n, 1);

	double x = 0;
	double res = 0;

	sort(ans + 1, ans + n + 1);
	double tmp = k * 1.0 / n;

	for(int i = 0; i < k; ++i) {
		res += tmp * ans[i+1];
		if(n - i - 1 == 0) break;
		tmp *= n - k - i;
		tmp /= n - i - 1;
	}

	printf("%.12lf\n", (double) res);
	return 0;
}


#include <bits/stdc++.h>
#ifndef M_PI
#define M_PI 3.14159265358979323846264338327
#endif // M_PI
#define endl "\n"
#define FOR(x, y, z) for (int x = (y); x < (z); ++x)
#define FORR(x, y, z) for (int x = (y); x > (z); --x)
#define GET(a, n) for (int __i = 0; __i < (n); ++__i) cin >> a[__i];
#define GETM(a, n, m) for (int __i = 0; __i < (n); ++__i) for (int __j = 0; __j < m; ++__j) cin >> a[__i][__j];
#define PRINTM(a, n, m) for (int __i = 0; __i < (n); ++__i) { for (int __j = 0; __j < m; ++__j) cout << a[__i][__j] << " ";  cout << endl; };
#define PRINT(a, n) for (int __i = 0; __i < (n); ++__i) cout << a[__i] << " ";
#define IT(a) a.begin(), a.end()
#define SQR(x) (x) * (x)
#define CASE(a, s) cout << "Case #" << a << ": " << s << endl;
#define DEB(a) cout << #a << " = " << (a) << endl; cout.flush();
#define DEBA(a) for (auto __i: a) cout << __i << " "; cout << endl; cout.flush();
#define IFDEB(b, a) if (b) { cout << #a << " = " << (a) << endl; cout.flush(); }
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef pair <int, int> PII;
typedef pair <LL, LL> PLL;
const int MOD = 1000000007;
struct Sync_stdio { Sync_stdio() { cin.tie(NULL); ios_base::sync_with_stdio(false); } } _sync_stdio;

template <class T> class SegmentTreeMax
{
    int maxn = 1000000;
    vector <vector <T>> t;
    vector <int> logs;
    void build (const vector <T> &a)
    {
        int n = a.size();
        int logn = sizeof(T) * 8 - __builtin_clz(n) - 1;
        t.assign(n, vector <T> (logn + 1));
        logs.push_back(0);
        FOR (i, 0, n) {
            t[i][0] = a[i];
            logs.push_back(sizeof(T) * 8 - __builtin_clz(i + 1) - 1);
        }
        FOR (j, 1, logn + 1) {
            FOR (i, 0, n - (1 << (j - 1))) {
                t[i][j] = max(t[i][j - 1], t[i + (1 << (j - 1))][j - 1]);
            }
        }
    }
public:
    inline T query(int l, int r)
    {
        return max(t[l][logs[r - l + 1]], t[r - (1 << logs[r - l + 1]) + 1][logs[r - l + 1]]);
    }
    SegmentTreeMax () {}
    SegmentTreeMax (const vector <int> &a) { build(a); }
};

template <class T> class SegmentTreeMin
{
    int maxn = 1000000;
    vector <vector <T>> t;
    vector <int> logs;
    void build (const vector <T> &a)
    {
        int n = a.size();
        int logn = sizeof(T) * 8 - __builtin_clz(n) - 1;
        t.assign(n, vector <T> (logn + 1));
        logs.push_back(0);
        FOR (i, 0, n) {
            t[i][0] = a[i];
            logs.push_back(sizeof(T) * 8 - __builtin_clz(i + 1) - 1);
        }
        FOR (j, 1, logn + 1) {
            FOR (i, 0, n - (1 << (j - 1))) {
                t[i][j] = min(t[i][j - 1], t[i + (1 << (j - 1))][j - 1]);
            }
        }
    }
public:
    inline T query(int l, int r)
    {
        return min(t[l][logs[r - l + 1]], t[r - (1 << logs[r - l + 1]) + 1][logs[r - l + 1]]);
    }
    SegmentTreeMin () {}
    SegmentTreeMin (const vector <int> &a) { build(a); }
};

SegmentTreeMax <int> t1;
SegmentTreeMin <int> t2;
int n, k;

int b_search(int l, int r)
{
    int start = l;
    if (l == r) {
        return min(100 * t1.query(start, l), t2.query(start, l));
    }
    while (l < r) {
        int m = (l + r) / 2;
        int x = 100 * t1.query(start, m);
        int y = t2.query(start, m + 1);
        if (x < y) {
            l = m + 1;
        } else {
            r = m;
        }
    }
    return min(100 * t1.query(start, l), t2.query(start, l));
}

int main()
{
    scanf("%d%d", &n, &k);
    vector <int> v(n);
    vector <int> c(n);
    FOR (i, 0, n) {
        scanf("%d", &v[i]);
    }
    FOR (i, 0, n) {
        scanf("%d", &c[i]);
    }
    t1 = SegmentTreeMax <int> (v);
    t2 = SegmentTreeMin <int> (c);
    vector <int> ans(n);
    FOR (i, 0, n) {
       ans[i] = b_search(i, n - 1);
    }
    sort(IT(ans));
    long double t = k * 1.0 / (n - k + 1);
    long double res = 0;
    FOR (i, 0, n - k + 1) {
        t *= (n - i - (k - 1)) * (long double)1.0 / (n - i);
        res += ans[i] * t;
    }
    printf("%.9lf\n", double(res));
}


#include <bits/stdc++.h>
#ifndef M_PI
#define M_PI 3.14159265358979323846264338327
#endif // M_PI
#define endl "\n"
#define FOR(x, y, z) for (int x = (y); x < (z); ++x)
#define FORR(x, y, z) for (int x = (y); x > (z); --x)
#define GET(a, n) for (int __i = 0; __i < (n); ++__i) cin >> a[__i];
#define GETM(a, n, m) for (int __i = 0; __i < (n); ++__i) for (int __j = 0; __j < m; ++__j) cin >> a[__i][__j];
#define PRINTM(a, n, m) for (int __i = 0; __i < (n); ++__i) { for (int __j = 0; __j < m; ++__j) cout << a[__i][__j] << " ";  cout << endl; };
#define PRINT(a, n) for (int __i = 0; __i < (n); ++__i) cout << a[__i] << " ";
#define IT(a) a.begin(), a.end()
#define SQR(x) (x) * (x)
#define CASE(a, s) cout << "Case #" << a << ": " << s << endl;
#define DEB(a) cout << #a << " = " << (a) << endl; cout.flush();
#define DEBA(a) for (auto __i: a) cout << __i << " "; cout << endl; cout.flush();
#define IFDEB(b, a) if (b) { cout << #a << " = " << (a) << endl; cout.flush(); }
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef pair <int, int> PII;
typedef pair <LL, LL> PLL;
const int MOD = 1000000007;
struct Sync_stdio { Sync_stdio() { cin.tie(NULL); ios_base::sync_with_stdio(false); } } _sync_stdio;

template <class T> class SegmentTreeMax
{
    int maxn = 1000000;
    vector <vector <T>> t;
    vector <int> logs;
    void build (const vector <T> &a)
    {
        int n = a.size();
        int logn = sizeof(T) * 8 - __builtin_clz(n) - 1;
        t.assign(n, vector <T> (logn + 1));
        logs.push_back(0);
        FOR (i, 0, n) {
            t[i][0] = a[i];
            logs.push_back(sizeof(T) * 8 - __builtin_clz(i + 1) - 1);
        }
        FOR (j, 1, logn + 1) {
            FOR (i, 0, n - (1 << (j - 1))) {
                t[i][j] = max(t[i][j - 1], t[i + (1 << (j - 1))][j - 1]);
            }
        }
    }
public:
    inline T query(int l, int r)
    {
        return max(t[l][logs[r - l + 1]], t[r - (1 << logs[r - l + 1]) + 1][logs[r - l + 1]]);
    }
    SegmentTreeMax () {}
    SegmentTreeMax (const vector <int> &a) { build(a); }
};

template <class T> class SegmentTreeMin
{
    int maxn = 1000000;
    vector <vector <T>> t;
    vector <int> logs;
    void build (const vector <T> &a)
    {
        int n = a.size();
        int logn = sizeof(T) * 8 - __builtin_clz(n) - 1;
        t.assign(n, vector <T> (logn + 1));
        logs.push_back(0);
        FOR (i, 0, n) {
            t[i][0] = a[i];
            logs.push_back(sizeof(T) * 8 - __builtin_clz(i + 1) - 1);
        }
        FOR (j, 1, logn + 1) {
            FOR (i, 0, n - (1 << (j - 1))) {
                t[i][j] = min(t[i][j - 1], t[i + (1 << (j - 1))][j - 1]);
            }
        }
    }
public:
    inline T query(int l, int r)
    {
        return min(t[l][logs[r - l + 1]], t[r - (1 << logs[r - l + 1]) + 1][logs[r - l + 1]]);
    }
    SegmentTreeMin () {}
    SegmentTreeMin (const vector <int> &a) { build(a); }
};

SegmentTreeMax <int> t1;
SegmentTreeMin <int> t2;
int n, k;

int b_search(int l, int r)
{
    int start = l;
    if (l == r) {
        return min(100 * t1.query(start, l), t2.query(start, l));
    }
    while (l < r) {
        int m = (l + r) / 2;
        int x = min(100 * t1.query(start, m), t2.query(start, m));
        int y = min(100 * t1.query(start, m + 1), t2.query(start, m + 1));
        if (x < y) {
            l = m + 1;
        } else {
            r = m;
        }
    }
    return min(100 * t1.query(start, l), t2.query(start, l));
}

int main()
{
    scanf("%d%d", &n, &k);
    vector <int> v(n);
    vector <int> c(n);
    FOR (i, 0, n) {
        scanf("%d", &v[i]);
    }
    FOR (i, 0, n) {
        scanf("%d", &c[i]);
    }
    t1 = SegmentTreeMax <int> (v);
    t2 = SegmentTreeMin <int> (c);
    vector <int> ans(n);
    FOR (i, 0, n) {
       ans[i] = b_search(i, n - 1);
    }
    sort(IT(ans));
    double t = k * 1.0 / n;
    double res = 0;
    FOR (i, 0, n - k + 1) {
        res += t * ans[i];
        t *= (n - (i + 1) - k + 1) * 1.0 / (n - (i + 1));
    }
    printf("%.6f\n", res);
}


#include <bits/stdc++.h>
#ifndef M_PI
#define M_PI 3.14159265358979323846264338327
#endif // M_PI
#define endl "\n"
#define FOR(x, y, z) for (int x = (y); x < (z); ++x)
#define FORR(x, y, z) for (int x = (y); x > (z); --x)
#define GET(a, n) for (int __i = 0; __i < (n); ++__i) cin >> a[__i];
#define GETM(a, n, m) for (int __i = 0; __i < (n); ++__i) for (int __j = 0; __j < m; ++__j) cin >> a[__i][__j];
#define PRINTM(a, n, m) for (int __i = 0; __i < (n); ++__i) { for (int __j = 0; __j < m; ++__j) cout << a[__i][__j] << " ";  cout << endl; };
#define PRINT(a, n) for (int __i = 0; __i < (n); ++__i) cout << a[__i] << " ";
#define IT(a) a.begin(), a.end()
#define SQR(x) (x) * (x)
#define CASE(a, s) cout << "Case #" << a << ": " << s << endl;
#define DEB(a) cout << #a << " = " << (a) << endl; cout.flush();
#define DEBA(a) for (auto __i: a) cout << __i << " "; cout << endl; cout.flush();
#define IFDEB(b, a) if (b) { cout << #a << " = " << (a) << endl; cout.flush(); }
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef pair <int, int> PII;
typedef pair <LL, LL> PLL;
const int MOD = 1000000007;
struct Sync_stdio { Sync_stdio() { cin.tie(NULL); ios_base::sync_with_stdio(false); } } _sync_stdio;

template <class T> class SegmentTreeMax
{
    int maxn = 1000000;
    vector <vector <T>> t;
    vector <int> logs;
    void build (const vector <T> &a)
    {
        int n = a.size();
        int logn = sizeof(T) * 8 - __builtin_clz(n) - 1;
        t.assign(n, vector <T> (logn + 1));
        logs.push_back(0);
        FOR (i, 0, n) {
            t[i][0] = a[i];
            logs.push_back(sizeof(T) * 8 - __builtin_clz(i + 1) - 1);
        }
        FOR (j, 1, logn + 1) {
            FOR (i, 0, n - (1 << (j - 1))) {
                t[i][j] = max(t[i][j - 1], t[i + (1 << (j - 1))][j - 1]);
            }
        }
    }
public:
    inline T query(int l, int r)
    {
        return max(t[l][logs[r - l + 1]], t[r - (1 << logs[r - l + 1]) + 1][logs[r - l + 1]]);
    }
    SegmentTreeMax () {}
    SegmentTreeMax (const vector <int> &a) { build(a); }
};

template <class T> class SegmentTreeMin
{
    int maxn = 1000000;
    vector <vector <T>> t;
    vector <int> logs;
    void build (const vector <T> &a)
    {
        int n = a.size();
        int logn = sizeof(T) * 8 - __builtin_clz(n) - 1;
        t.assign(n, vector <T> (logn + 1));
        logs.push_back(0);
        FOR (i, 0, n) {
            t[i][0] = a[i];
            logs.push_back(sizeof(T) * 8 - __builtin_clz(i + 1) - 1);
        }
        FOR (j, 1, logn + 1) {
            FOR (i, 0, n - (1 << (j - 1))) {
                t[i][j] = min(t[i][j - 1], t[i + (1 << (j - 1))][j - 1]);
            }
        }
    }
public:
    inline T query(int l, int r)
    {
        return min(t[l][logs[r - l + 1]], t[r - (1 << logs[r - l + 1]) + 1][logs[r - l + 1]]);
    }
    SegmentTreeMin () {}
    SegmentTreeMin (const vector <int> &a) { build(a); }
};

SegmentTreeMax <int> t1;
SegmentTreeMin <int> t2;
int n, k;

int ternary_search(int l, int r)
{
    int start = l;
    int end = r;
    while (r - l >= 3) {
        int m1 = l + (r - l) / 3;
        int m2 = r - (r - l) / 3;
        int s1 = min(100 * t1.query(start, m1), t2.query(start, m1));
        int s2 = min(100 * t1.query(start, m2), t2.query(start, m2));
        if (s1 < s2) {
            l = m1;
        } else {
            r = m2;
        }
    }
    int res = 0;
    FOR (i, l, min(l + 3, end + 1)) {
        res = max(res, min(100 * t1.query(start, i), t2.query(start, i)));
    }
    return res;
}

int main()
{
    scanf("%d%d", &n, &k);
    vector <int> v(n);
    vector <int> c(n);
    FOR (i, 0, n) {
        scanf("%d", &v[i]);
    }
    FOR (i, 0, n) {
        scanf("%d", &c[i]);
    }
    t1 = SegmentTreeMax <int> (v);
    t2 = SegmentTreeMin <int> (c);
    vector <LL> ans(n);
    FOR (i, 0, n) {
       ans[i] = ternary_search(i, n - 1);
    }
    sort(IT(ans));
    long double t = 1;
    long double res = 0;
    FOR (i, 0, n - k + 1) {
        t *= (n - (k - 1) - i) * (long double)1.0 / (n - i);
        res += ans[i] * t;
    }
    printf("%.9lf\n", double(res));
}


#include <bits/stdc++.h>
#ifndef M_PI
#define M_PI 3.14159265358979323846264338327
#endif // M_PI
#define endl "\n"
#define FOR(x, y, z) for (int x = (y); x < (z); ++x)
#define FORR(x, y, z) for (int x = (y); x > (z); --x)
#define GET(a, n) for (int __i = 0; __i < (n); ++__i) cin >> a[__i];
#define GETM(a, n, m) for (int __i = 0; __i < (n); ++__i) for (int __j = 0; __j < m; ++__j) cin >> a[__i][__j];
#define PRINTM(a, n, m) for (int __i = 0; __i < (n); ++__i) { for (int __j = 0; __j < m; ++__j) cout << a[__i][__j] << " ";  cout << endl; };
#define PRINT(a, n) for (int __i = 0; __i < (n); ++__i) cout << a[__i] << " ";
#define IT(a) a.begin(), a.end()
#define SQR(x) (x) * (x)
#define CASE(a, s) cout << "Case #" << a << ": " << s << endl;
#define DEB(a) cout << #a << " = " << (a) << endl; cout.flush();
#define DEBA(a) for (auto __i: a) cout << __i << " "; cout << endl; cout.flush();
#define IFDEB(b, a) if (b) { cout << #a << " = " << (a) << endl; cout.flush(); }
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef pair <int, int> PII;
typedef pair <LL, LL> PLL;
const int MOD = 1000000007;
struct Sync_stdio { Sync_stdio() { cin.tie(NULL); ios_base::sync_with_stdio(false); } } _sync_stdio;

template <class T> class SegmentTreeMax
{
    int maxn = 1000000;
    vector <vector <T>> t;
    vector <int> logs;
    void build (const vector <T> &a)
    {
        int n = a.size();
        int logn = sizeof(T) * 8 - __builtin_clz(n) - 1;
        t.assign(n, vector <T> (logn + 1));
        logs.push_back(0);
        FOR (i, 0, n) {
            t[i][0] = a[i];
            logs.push_back(sizeof(T) * 8 - __builtin_clz(i + 1) - 1);
        }
        FOR (j, 1, logn + 1) {
            FOR (i, 0, n - (1 << (j - 1))) {
                t[i][j] = max(t[i][j - 1], t[i + (1 << (j - 1))][j - 1]);
            }
        }
    }
public:
    inline T query(int l, int r)
    {
        return max(t[l][logs[r - l + 1]], t[r - (1 << logs[r - l + 1]) + 1][logs[r - l + 1]]);
    }
    SegmentTreeMax () {}
    SegmentTreeMax (const vector <int> &a) { build(a); }
};

template <class T> class SegmentTreeMin
{
    int maxn = 1000000;
    vector <vector <T>> t;
    vector <int> logs;
    void build (const vector <T> &a)
    {
        int n = a.size();
        int logn = sizeof(T) * 8 - __builtin_clz(n) - 1;
        t.assign(n, vector <T> (logn + 1));
        logs.push_back(0);
        FOR (i, 0, n) {
            t[i][0] = a[i];
            logs.push_back(sizeof(T) * 8 - __builtin_clz(i + 1) - 1);
        }
        FOR (j, 1, logn + 1) {
            FOR (i, 0, n - (1 << (j - 1))) {
                t[i][j] = min(t[i][j - 1], t[i + (1 << (j - 1))][j - 1]);
            }
        }
    }
public:
    inline T query(int l, int r)
    {
        return min(t[l][logs[r - l + 1]], t[r - (1 << logs[r - l + 1]) + 1][logs[r - l + 1]]);
    }
    SegmentTreeMin () {}
    SegmentTreeMin (const vector <int> &a) { build(a); }
};

SegmentTreeMax <int> t1;
SegmentTreeMin <int> t2;
int n, k;

int ternary_search(int l, int r)
{
    int start = l;
    int end = r;
    while (r - l >= 3) {
        int m1 = l + (r - l) / 3;
        int m2 = r - (r - l) / 3;
        int s1 = min(100 * t1.query(start, m1), t2.query(start, m1));
        int s2 = min(100 * t1.query(start, m2), t2.query(start, m2));
        if (s1 < s2) {
            l = m1;
        } else {
            r = m2;
        }
    }
    int res = 0;
    FOR (i, l, min(l + 3, end + 1)) {
        res = max(res, min(100 * t1.query(start, i), t2.query(start, i)));
    }
    return res;
}

int main()
{
    scanf("%d%d", &n, &k);
    vector <int> v(n);
    vector <int> c(n);
    FOR (i, 0, n) {
        scanf("%d", &v[i]);
    }
    FOR (i, 0, n) {
        scanf("%d", &c[i]);
    }
    t1 = SegmentTreeMax <int> (v);
    t2 = SegmentTreeMin <int> (c);
    vector <LL> ans(n);
    FOR (i, 0, n) {
       ans[i] = ternary_search(i, n - 1);
    }
    sort(IT(ans));
    long double t = k * 1.0 / (n - k + 1);
    long double res = 0;
    FOR (i, 0, n - k + 1) {
        t *= (n - i - (k - 1)) * (long double)1.0 / (n - i);
        res += ans[i] * t;
    }
    printf("%.9lf\n", double(res));
}