Bitcoin is a digital currency created in 2009.It follows the ideas set out in a white paper by the mysterious Satoshi Nakamoto, whose true identity has yet to be verified. Bitcoin offers the promise of lower transaction fees than traditional online payment mechanisms and is operated by a decentralized authority, unlike government-issued currencies.
Bitcoin’s price is increasing day by day. In 2010. 1 Bitcoin was equivalent to 18,000. An analyst is predicting that 1 bitcoin will be equal to $25,000 within the next five years. Its value sometimes decreases by some small amount but overall its price is increasing.
Based on this real life scenario, Let us consider that you have currently P. But, exactly after D days, its value increases by L which is less than P i.e. (L<P). And again this scenario continues infinitely in the same manner. (I.e. exactly at the interval of D+1 day, value increases by L, other days it increases by P). Your task is to predict how many days does it take to reach dollar amount at least X.
Input starts with an integer T(1<=T<=100000) , denoting the number of test cases. Each case starts with 5 integers B, P, D, L, and X.
Constraints:
1<=B,D,X<=10^9
1<=L < P<=10^9
For each case of input minimum number of days needed to reach dollar value of at least X in a single line.
Input | Output |
---|---|
2 2 5 4 3 51 2 5 4 3 46 | 11 10 |