Chef is known for his innovative and unconventional cooking techniques. He believes that the secret to creating the most delicious dishes lies in the chaos of his ingredients. To test this theory, he devised a peculiar way of arranging his cookbook.
Chef has N recipes, each assigned a unique "deliciousness score" from 1 to 10^9. He wants to arrange these recipes in his cookbook to maximize what he calls the "Chaotic Deliciousness Density."
A chaotic pair in the cookbook is any pair of recipes where a less delicious recipe appears after a more delicious one. The Chaotic Deliciousness Density is calculated as the ratio of the number of chaotic pairs to the total number of recipes in the arrangement.
Chef wants to find the longest possible arrangement of recipes that maximizes the Chaotic Deliciousness Density. He believes this will lead to the most innovative and delicious meal combinations.