#P2721. 小 Q 的赚钱计划

小 Q 的赚钱计划

Description

Xiao Q decides to make big money in the new year, and Xiao P recommends financial products. At the beginning of this (non-leap) year, Xiao Q has 10510^5 yuan. There are NN financial products, each described by three parameters: release date, investment days, and annual interest rate. At any moment, Xiao Q can hold at most one product. Find the maximum amount of money attainable after one year.

Input Format

The first line contains an integer NN.

Each of the next NN lines contains three space-separated values A,B,CA, B, C:

  • AA denotes the release date, in the format MMDD.
  • BB is an integer, the number of investment days, in the range [10,300][10,300].
  • CC has at most 22 decimal places, representing the annual interest rate in percent, in the range [3,30][3,30].

Output Format

A single number: the maximum total funds (principal plus interest) obtainable at the end of the year, rounded to two decimal places.

3
0101 100 4.5
0201 30 5
0402 50 7.8
101483.84

Hint

0N1040 \le N \le 10^4

Translated by ChatGPT 5