HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Repetition (Loops) > problem:


018. 50491 - Brokers

Guest
• Review clarifications (5)

Volume problems

• Reflektimi i pikes
• 50994 - The Most Crowded Station
• 51194 - The difference between max...
• 002. 50554 - nth power of m
• 004. 50424 - Area
• 004. 50522 - Multiplication Table - 2
• 012. 50352 - Selling Cows
• 017. 50537 - esreveR Triangle
• 018. 50491 - Brokers
• 018. 50787 - Expected Value
• 020. 50485 - Center of gravity of a ...
• 024. 50372 - Number Quadruplets
• 025- 2013-Nov-01. 50328 - How far ...
• 026. 50487 - Radius of Inscribed Circle
• 027. 50548 - Albanian Airlines
• 028. 50483 - Group Total
• 033. 50588 - Processing the list of n...

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Urmat Ryskulov.

Brokers

Mr. Sinani works in a brokerage company. Essentially, he buys or sells shares from the stock market. In financial markets, equity valuation is the method of calculating theoretical values of companies and their stocks. He wants your support to choose the most profitable share.

Current price of an object is calculated as follows: if the dividends paid are same forever (which means the growth rate is zero), then, the price of the particular stock is P0 = D / R. If the dividends paid over the years are not constant and have certain growth, the price of particular stock is;
   P0 = D1 / (R-g) = D0 * (1+g) / (R - g)
where

  • P0 - current price
  • D0 - just paid dividend
  • D1 - payment for next period (D1= D0*(1+g))
  • R - Market required rate of return
  • g - growth rate

Question: You will be given information for n shares. Write a program to choose the most profitable share among the given.

Input specification
First, you will be given an integer n where n is between 0 and 2000. Then, in the following n lines, you will be given the information for n shares where every line contains the following information:

  • Stock market symbol - a string not greater than 8 characters
  • D0 - a floating point number between 0 and 1000
  • R - a floating point number between 0 and 1
  • g - a floating point number between 0 and 1

Output specification
Show the stock market symbol of the share which has the highest equity value. If there are several equity having the same price, show the first one.

Sample Input I
2
GOOG 5.5 0.06 0
HYMTF 5 0.08 0.04
Sample Output I
HYMTF

Explanation:
Current price for GOOG is 91.67 and for HYMTF 5 is 130. And so, the most profitable equity is HYMTF



Для отправки решений необходимо выполнить вход.

www.contester.ru