No.734 Careful Engineer
Problem Statement
A certain engineer takes $C$ hours to write a program that finishes $1$ task, which takes $A$ minutes by hand, in $B$ seconds.
If you want to finish $X$ of these tasks as quickly as possible, for $X$ at least what value should the program be written? If the program should not be written no matter how large $X$ is, print $-1$.
Correction 2018/09/28 22:12: If the time taken by hand and the time taken with the program are equal, the program is written.
Input
$A$ $B$ $C$
$\cdot$ $1 \le A,B,C \le 10^{9}$
$\cdot$ All inputs are integers.
Output
Print one integer.
Sample
Sample 1
Input
3 3 3
Output
62
Since $A=180$[seconds], $B=3$[seconds], and $C=10800$[seconds],
the time taken through the $61$st task is $61\times180=10980$ seconds by hand and $10800+61\times3=10983$ seconds with the program.
Similarly, the time taken through the $62$nd task is $11160$ seconds by hand and $10986$ seconds with the program, so the program should be written when there are at least $62$ tasks.
Sample 2
Input
30 3 3
Output
7
Task $6$: by hand $10800s$, with the program $10818s$
Task $7$: by hand $12600s$, with the program $10821s$
Therefore, the program should be written when there are at least $7$ tasks.
Sample 3
Input
1 70 1
Output
-1
Doing the tasks by hand finishes them faster than running the program, so the program should not be written.
Sample 4
Input
180 8100 85885
Output
114514
The program should be written when there are at least $114514$ tasks.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
Tqk