Jimmy and NITT WiFi
All submissions for this problem are available.
Jimmy decides to watch his favorite TV show online. But NITT WiFi is slow and the video hangs if enough data is not
buffered. He wants to watch the video without any such interruptions. If he waits for some T seconds, some part of
the video will be download. After T seconds, he can start watching. He does'nt have to wait for the
whole video to download as the video can download after the starts watching.
Let the whole video be N seconds long. Jimmy has to wait T seconds before he can start watching.
Please note that at any moment of time, the data downloaded must not be less than what is required to watch
that second of the video.
Jimmy is impatient and wants to wait as little as possible. Being his friend, you have to tell him how many
seconds he has to wait to watch the video without interruption.
Please see sample test cases for more clarity.
Each file has only Q test cases.
For each test case:
The first line contains three space-separated integers x, y and z.
x - kB required to watch 1 second of the video
y - Download speed in kB/s
z - Duration of the video in seconds
For each test case print an integer T, the time in seconds to wait.
Input: 2 60 16 1 2 1 1 Output: 3 1
Example case 1.
After 3 sec, 48kB data is downloaded. So, they start watching and by the end of 4th sec,
64kB is downloaded and they only need 60kB to watch.
Example case 2.
After 1 sec, 1kB is downloaded. So, they start watching and by the end of 2nd sec, 2kB is downloaded which is the size of the video.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions