Welcome to ZOJ
Information
Select Problem
Runs
Ranklist
ZOJ Problem Set - 3566
Stock III

Time Limit: 2 Seconds      Memory Limit: 65536 KB

The capital stock (or just stock) of a business entity represents the original capital paid into or invested in the business by its founders. It serves as a security for the creditors of a business since it cannot be withdrawn to the detriment of the creditors. Stock is distinct from the property and the assets of a business which may fluctuate in quantity and value.

A warrant is a security that entitles the holder to buy the underlying stock of the issuing company at a fixed exercise price until the expiry date. Warrants and options are similar in that the two contractual financial instruments allow the holder special rights to buy securities. Both are discretionary and have expiration dates. The word warrant simply means to "endow with the right", which is only slightly different to the meaning of an option.

Warrant and stock are closely related, and warrant has a higher risk factor than the stock. There are a lot of technical terms and rules. But in this problem, you only need to know the rules as follows:

  • Strike price: Each warrant has its own strike price, which means that you can buy or sell some shares of the stock at this price, and the stock is called underlying asset.
  • Two types of warrants: Call option and put option. If you have some call options, you can buy the corresponding stock at the strike price. And the put option is opposite.
  • Intrinsic value: It is determined by the price of its underlying asset. For example, intrinsic value of call option = (stock price - strike price) * strike ratio. And the put option is similar.
  • Strike ratio: It means the number of shares of the underlying asset one share of warrant can buy or sell.
  • High Limit: For a stock, today's high limit = yesterday's closing price of stock * 110%. For a warrant, today's high limit = yesterday's closing price of warrant + (high limit of underlying asset - yesterday's closing price of underlying asset) * 125% * strike ratio.
  • Low Limit: For a stock, today's low limit = yesterday's closing price of stock * 90%. For a warrant, today's low limit = yesterday's closing price of warrant - (yesterday's closing price of underlying asset - low limit of underlying asset) * 125% * strike ratio.
  • Unit Price: The smallest unit price of stock is 0.01 yuan each share, while the smallest unit price of warrant is 0.001 yuan each share. Your result of calculation should be round to the integer multiple of the unit price. The minimal possible price of stock and warrant is its unit price.
  • Fee: When you buy in or sell out your stock or warrant, you should pay 0.3% of turnover to the brokerage as the fee. Each transaction should pay 5 yuan at least. When you use the warrant to buy or sell corresponding stock, you should pay the 0.05% of the total value of the stock as the transfer fee.

SXSTAR knows the closing price of one warrant's underlying asset today, and other basic information about the warrant. Coincidentally, the closing price of this warrant is the most nearly price to its intrinsic value (using rounding method). SXSTAR doesn't like to calculate. So, could you please calculate the possible range of warrant price tomorrow?

Input

There are several test cases (<=200). You should process to the end of input. For each test case, the first line has one integers N, which means the warrant type, 1 is for call and 2 is for put. The second line is a positive real number (<= 100000, at most has 2 decimal places), which means the closing price of one warrant's underlying asset today. The second line is a positive real number (<= 100000, at most has 2 decimal places), which means the strike price of this warrant. The forth line is a positive real number (<= 100000, at most has 4 decimal places), which means the strike ratio of this warrant.

Output

For each case, you should print a single line with two real numbers indicating the range of the warrant price tomorrow, and the first one should not be bigger than the second one. Two numbers should be separated by a space. Your answer should round to three decimal places.

Sample Input

1
200
100
1

Sample Output

75.000 125.000

Author: SHEN, Xin
Contest: ZOJ Monthly, December 2011
Submit    Status