Problem Statement | |||||||||||||
| You have implemented a sorting algorithm that requires exactly c*n*lg(n) nanoseconds to sort n integers. Here lg denotes the base-2 logarithm. Given time nanoseconds, return the largest double n such that c*n*lg(n) <= time. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Notes | |||||||||||||
| - | lg(n) = ln(n)/ln(2) where ln denotes the natural log. | ||||||||||||
| - | Your return value must have a relative or absolute error less than 1e-9. | ||||||||||||
Constraints | |||||||||||||
| - | c will be between 1 and 100 inclusive. | ||||||||||||
| - | time will be between 1 and 2000000000 inclusive. | ||||||||||||
Examples | |||||||||||||
| 0) | |||||||||||||
| |||||||||||||
| 1) | |||||||||||||
| |||||||||||||
| 2) | |||||||||||||
| |||||||||||||
| 3) | |||||||||||||
| |||||||||||||