301031: CF195A. Let's Watch Football

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Let's Watch Football

题意翻译

输入三个整数$a$,$b$,$c$。已知有方程$tb+cb=ac$,求t的值(向上取整)。

题目描述

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 first line contains three space-separated integers $ a $ , $ b $ and $ c $ $ (1<=a,b,c<=1000,a&gt;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.

Input

题意翻译

题目描述 Valeric和Valerko错过了最后一场欧洲杯足球赛,所以他们决定在网上观看比赛的关键时刻。他们想尽快开始观看,但连接速度太低。如果他们现在打开视频,它将“挂断”,因为每秒观看的数据大小将超过每秒下载的数据大小。 这些家伙想要在没有任何停顿的情况下观看整个视频,所以他们必须等待一些整数秒的时间才能下载视频的一部分。在这几秒钟过去之后,他们就可以开始观看了。等待整个视频下载是不必要的,因为视频可以下载后,他们才开始观看。 假设视频的长度是c,秒Valeric和Valerko在观看前等待了几秒钟。那么在任时刻t≤t0≤c+t则必须满足以下条件:以秒为单位接收的数据的大小不小于观看视频的-t秒所需的数据的大小。 当然,这些人希望等待的时间越短越好,所以你的任务是找到在打开视频之前等待的最小整数秒数。伙计们必须不停地看视频 输入格式 第一行包含三个空格分隔的整数a,带(1<=a,b,c<=1000a>b)。第一个数字(a)表示观看视频一秒钟所需的数据量。第二个数字(b)表示Valeric和Valerko每秒可以从网上下载的数据大小。第三个数字(c) 表示视频的长度(秒)。 输出格式打印一个数字--Valeric和Valerko为了不间断地观看足球比赛必须等待的最小整数秒数。 说明/提示 第一个样本视频的长度为1秒,观看1秒需要4个数据单位,所以人们需要下载4,1=4单位的数据来观看整个视频。最理想的方式是等待3秒,直到3单位的数提将被下载,然后开始观看。当人们将观看1秒的视频时,一个数据单位将被下载而Valerik和Valerko将在观看结束时有4个数据单位。而且,在视频结束之前的每一刻,男人们都会有更多的数据,然后才是观看视频所必需的。 在第二个样本中,人们需要2.10=20个单位的数据,所以他们必须等待5秒,之后他们将在第二秒结束前获得20个单位的数据。然而,如果男人等待4秒,他们将能够观看视频的第一秒没有暂停,但他们将下载18个单位的数据由第二秒结束,它是那么不必要

加入题单

算法标签: