ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Сборники > Фёдор Меньшиков. Тренировки > задача:


018. 50491 - Brokers

Гость
• Вопросы к жюри (5)

Задачи сборника

• 010. 50782 - Max of N integers
• 012. 50352 - Selling Cows
• 012. 50589 - Numri i vezeve te shitura
• 015. 50466 - Drawing Square From...
• 016. 50463 - Drawing a Triangle
• 017. 50423 - Numbers square
• 017. 50537 - esreveR Triangle
• 018. 50344 - Profit or Loss
• 018. 50491 - Brokers
• 018. 50787 - Expected Value
• 019. 50438 - Pattern with stars
• 020. 50485 - Center of gravity of a ...
• 020. 50408 - Molecules
• 022. 50366 - Student Averages (2 G...
• 023. 50437 - Age Labeling
• 024. 50372 - Number Quadruplets
• 025- 2013-Nov-01. 50328 - How far ...

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
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