Problem Description
Loading...
Problem Analysis
Binary search on the result
For the current mid, calculate how many pieces it can produce
Compare it with k
The check condition is also easy to write
However…
This is a precision-sensitive problem
Note that, because of the problem statement,
the final result cannot be rounded
it needs to be truncated
And base conversion and the bizarre mechanics of double
make the final data handling in this problem quite troublesome
Here I was forced into it…
so I used a rather amusing way to output…
Test data:
| |
cpp
| |