“今日头条杯”首届湖北省大学程序设计竞赛-G. Coins

链接:https://www.nowcoder.com/acm/contest/104/F
来源:牛客网

时间限制:C/C++ 1秒,其他语言2秒
空间限制:C/C++ 262144K,其他语言524288K
64bit IO Format: %lld

题目描述

In the latest activity in the game, you want to find the most efficient way to collect at least Z coins. There is a battle in this game. Everytime you finish the battle, you can get N coins. To make the activity more interesting, you can spend X coins to exchange a special card. If you carry K cards in the battle, you can get coins when you finish the battle rather than only N coins. So how many times will you finish the battle at least?

输入描述:

 
  

\emph{Input contains multiple but no more than 10 test cases}, the first line of input is an integer T, the number of test cases.

In the following T lines each line has for integers (), and the meaning of them have been mentioned.

输出描述:

For each case, please output the minimum times you should finish the battle.

猜你喜欢

转载自blog.csdn.net/qq_37064135/article/details/80054149