Problem Statement | |||||||||||||
You would like to compress a video file to fit within a specified file size. You are given the length of the video formatted as "HH:MM:SS" (quotes for clarity only), where HH, MM and SS are two-digit numbers specifying the number of hours, minutes and seconds, respectively. You are also given the desired file size in megabytes. Return the maximum bitrate in kbps (kilobits per second) at which you can encode the video without exceeding the desired size. Please refer to the notes for information on conversion between different units. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Notes | |||||||||||||
- | The return value must have absolute or relative accuracy within 1e-9. | ||||||||||||
- | One megabyte is equivalent to 1,048,576 bytes. | ||||||||||||
- | One byte is equivalent to 8 bits. | ||||||||||||
- | One kilobit is equivalent to 1,000 bits. | ||||||||||||
Constraints | |||||||||||||
- | length is formatted as "HH:MM:SS", where HH is a two-digit integer between 00 and 20, inclusive, MM is a two-digit integer between 00 and 59, inclusive, and SS is a two-digit integer between 00 and 59, inclusive. | ||||||||||||
- | desiredSize is between 50 and 8000, inclusive. | ||||||||||||
- | length will represent a time of at least 1 second. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
| |||||||||||||
4) | |||||||||||||
|