CF195A.Let's Watch Football
入门
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
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.
瓦列里克和瓦列尔科错过了最后一场欧洲足球赛,因此他们决定在网上观看比赛的关键片段。他们希望尽快开始观看,但网络连接速度太慢。如果他们现在就开启视频,视频将会“卡住”,因为每秒需要播放的数据量超过了每秒下载的数据量。
两人希望全程无中断地观看整段视频,因此他们必须等待一个整数秒数,让部分视频提前下载完成。经过这一秒数后,他们便可以开始观看。无需等待整段视频全部下载完毕,因为在他们开始观看后,视频仍可继续下载。
假设视频总时长为 c 秒,瓦列里克和瓦列尔科在开始观看前等待 t 秒。那么,对于任意时刻 t0(满足 t≤t0≤c+t),以下条件必须成立:在 t0 秒内接收到的数据量不小于播放 t0−t 秒视频所需的数据量。
显然,两人希望等待时间尽可能短,因此你的任务是求出开始播放视频前所需的最小整数等待秒数。两人必须全程无中断地观看视频。
输入格式
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.
第一行包含三个以空格分隔的整数 a、b 和 c(1 ≤ a,b,c ≤ 1000,且 a > b)。第一个数 a 表示观看视频每秒所需的数据量;第二个数 b 表示 Valeric 和 Valerko 每秒能从网络下载的数据量;第三个数 c 表示视频的时长(单位:秒)。
输出格式
Print a single number — the minimum integer number of seconds that Valeric and Valerko must wait to watch football without pauses.
输出一个整数——Valeric 和 Valerko 为 uninterrupted 地观看足球比赛所需等待的最少秒数。
输入输出样例
输入#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.
在第一个样例中,视频长度为 1 秒,观看 1 秒视频需要 4 单位数据,因此两人需下载 4⋅1=4 单位数据才能完整观看该视频。最优策略是等待 3 秒,待下载完 3 单位数据后开始观看。在观看视频的 1 秒过程中,将额外下载 1 单位数据,因此到视频结束时,瓦列里克和瓦列尔科恰好拥有 4 单位数据。此外,在视频结束前的任意时刻,他们所拥有的数据量均不少于当前所需观看的数据量。
在第二个样例中,两人共需 2⋅10=20 单位数据,因此必须等待 5 秒;这样,在第 2 秒结束前,他们即可拥有 20 单位数据。然而,若仅等待 4 秒,则虽能无中断地观看视频的第 1 秒,但在第 2 秒结束时仅能下载 18 单位数据,少于所需数据量。
输入解题思路,AI测评打分。不知道怎么写?