Xyene is preparing for the MMORPG ScapeRune's Double XP Weekend. In ScapeRune, there are many skills, with each player having a certain integer amount of experience in it. Xyene currently has
experience in the Uncooking skill (a skill dedicated to the uncooking of cooked fish), and he would like to get
experience in Uncooking. In order to do so, he will need to uncook fish, with the uncooking of each fish awarding him experience. Uncooking each fish costs
coins each, and gives
base experience.
A player may also possess bonus experience in a skill. Bonus experience is converted into actual experience every time a player gains experience, with amount of bonus experience used up equal to the base experience earned. Xyene currently has
bonus experience in the uncooking skill.
On Double XP Weekend, Xyene earns an additional amount of extra experience equal to the base experience of any actions he performed. In other words, if he uncooks some fish, he would earn an extra
experience. This effect does not stack with bonus experience on Double XP Weekend: assuming he has enough bonus experience, Xyene earns
experience every time he uncooks fish, consuming
bonus experience.
Xyene would like to know how much fish he must uncook and how much money he would need to spend in order to achieve his goal of
experience.
Input Specification
The input consists of the following integers, each on its own line, in order:
: Xyene's current experience in Uncooking
.
: Xyene's desired experience in Uncooking
.
: Xyene's current bonus experience in Uncooking
.
: the experience gained by the type of fish Xyene is Uncooking
.
: the cost per fish
.
Output Specification
The output consists of two lines, the first containing the number of fish Xyene needs to uncook, and the second the amount of coins doing so would cost him.
Sample Input
Copy
1798808
9684577
1048576
325
4428
Sample Output
Copy
10519
46578132
Explanation
Xyene currently has
experience in Uncooking and he wants to get to
experience. He has
bonus experience. In order to do so, he will be uncooking food that gives
experience per item, with each food item costs
to uncook.
- For the first
fish Xyene uncooks, he earns
base experience,
extra experience from Bonus XP Weekend, and
bonus experience is converted to real experience, for a total of
experience per fish. This will earn him
experience, in total.
- For the
fish, he would only convert
bonus experience, as he has no more left. This makes him earn
experience for it.
- If he uncooks
more fish, he would be able to get
more experience (at the rate of
per fish, since he is out of bonus experience).
After finishing his supply of fish, his final experience would be
, which is
experience above his goal. He could not uncook less fish and still reach his goal.
Therefore, Xyene must uncook
fish, at a cost of
coins.
Comments
I is not understand this problem
Why do I understand everything about the question, including the rules of double XP, the 200 million xp constraint, the uncooking skill, and the name of the MMORPG? I feel like I have no life. -_-
Maybe you do...
PS NXT Client FTW.
This problem is way too real.
GZ ON 99 SUMMONING o wait
For
and 
, the constraints refer to 
>_<