A8648 | Let's Watch Football
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
Valeric and Valerko missed the last Euro football game, so they decided to watch the game's key moments on the Net. They want to start watching as soon as possible but the connection speed is too low. If they turn on the video right now, it will "hang up" as the size of data to watch per second will be more than the size of downloaded data per second.
The guys want to watch the whole video without any pauses, so they have to wait some integer number of seconds for a part of the video to download. After this number of seconds passes, they can start watching. Waiting for the whole video to download isn't necessary as the video can download after the guys started to watch.
Let's suppose that video's length is $c$ seconds and Valeric and Valerko wait $t$ seconds before the watching. Then for any moment of time $t_{0}$ , $t<=t_{0}<=c+t$ , the following condition must fulfill: the size of data received in $t_{0}$ seconds is not less than the size of data needed to watch $t_{0}-t$ seconds of the video.
Of course, the guys want to wait as little as possible, so your task is to find the minimum integer number of seconds to wait before turning the video on. The guys must watch the video without pauses.
The guys want to watch the whole video without any pauses, so they have to wait some integer number of seconds for a part of the video to download. After this number of seconds passes, they can start watching. Waiting for the whole video to download isn't necessary as the video can download after the guys started to watch.
Let's suppose that video's length is $c$ seconds and Valeric and Valerko wait $t$ seconds before the watching. Then for any moment of time $t_{0}$ , $t<=t_{0}<=c+t$ , the following condition must fulfill: the size of data received in $t_{0}$ seconds is not less than the size of data needed to watch $t_{0}-t$ seconds of the video.
Of course, the guys want to wait as little as possible, so your task is to find the minimum integer number of seconds to wait before turning the video on. The guys must watch the video without pauses.
输入格式
The first line contains three space-separated integers $a$ , $b$ and $c$ $(1<=a,b,c<=1000,a>b)$ . The first number ( $a$ ) denotes the size of data needed to watch one second of the video. The second number ( $b$ ) denotes the size of data Valeric and Valerko can download from the Net per second. The third number ( $c$ ) denotes the video's length in seconds.
输出格式
Print a single number — the minimum integer number of seconds that Valeric and Valerko must wait to watch football without pauses.
输入输出样例
输入 #1
4 1 1
输出 #1
3
输入 #2
10 3 2
输出 #2
5
输入 #3
13 12 1
输出 #3
1
In the first sample video's length is 1 second and it is necessary 4 units of data for watching 1 second of video, so guys should download 4 $·$ 1 = 4 units of data to watch the whole video. The most optimal way is to wait 3 seconds till 3 units of data will be downloaded and then start watching. While guys will be watching video 1 second, one unit of data will be downloaded and Valerik and Valerko will have 4 units of data by the end of watching. Also every moment till the end of video guys will have more data then necessary for watching.
In the second sample guys need 2 $·$ 10 = 20 units of data, so they have to wait 5 seconds and after that they will have 20 units before the second second ends. However, if guys wait 4 seconds, they will be able to watch first second of video without pauses, but they will download 18 units of data by the end of second second and it is less then necessary.
In the second sample guys need 2 $·$ 10 = 20 units of data, so they have to wait 5 seconds and after that they will have 20 units before the second second ends. However, if guys wait 4 seconds, they will be able to watch first second of video without pauses, but they will download 18 units of data by the end of second second and it is less then necessary.
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted