#K50902. Largest Stock Price Change

    ID: 28967 Type: Default 1000ms 256MiB

Largest Stock Price Change

Largest Stock Price Change

You are given a chronological list of stock prices along with their corresponding dates in the format (YYYY-MM-DD). Your task is to find the day from which the largest change in stock price occurs. The change is defined as the difference between a day's price and the previous day's price. Mathematically, if (P_i) represents the stock price on day (i) and the days are in order, then the change on day (i) is (\Delta = P_i - P_{i-1}). You should output the date of the previous day corresponding to this maximum absolute change and the change value itself. If there are fewer than two records, output an empty string and (0.0).

inputFormat

The input is read from standard input (stdin). The first line contains an integer (n) (where (n \ge 0)) representing the number of days. Each of the following (n) lines contains a date and a stock price separated by a space. The date is in the format (YYYY-MM-DD) and the price is a floating-point number.

outputFormat

Print to standard output (stdout) the date corresponding to the day from which the largest change originates and the change value, separated by a space. If there are fewer than two records, print an empty string followed by (0.0).## sample

0
 0.0

</p>