CF718A.Efim and Strange Grade

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Efim just received his grade for the last test. He studies in a special school and his grade can be equal to any positive decimal fraction. First he got disappointed, as he expected a way more pleasant result. Then, he developed a tricky plan. Each second, he can ask his teacher to round the grade at any place after the decimal point (also, he can ask to round to the nearest integer).

There are tt seconds left till the end of the break, so Efim has to act fast. Help him find what is the maximum grade he can get in no more than tt seconds. Note, that he can choose to not use all tt seconds. Moreover, he can even choose to not round the grade at all.

In this problem, classic rounding rules are used: while rounding number to the nn -th digit one has to take a look at the digit n+1n+1 . If it is less than 55 than the nn -th digit remain unchanged while all subsequent digits are replaced with 00 . Otherwise, if the n+1n+1 digit is greater or equal to 55 , the digit at the position nn is increased by 11 (this might also change some other digits, if this one was equal to 99 ) and all subsequent digits are replaced with 00 . At the end, all trailing zeroes are thrown away.

For example, if the number 1.141.14 is rounded to the first decimal place, the result is 1.11.1 , while if we round 1.51.5 to the nearest integer, the result is 22 . Rounding number 1.2999961211.299996121 in the fifth decimal place will result in number 1.31.3 .

输入格式

The first line of the input contains two integers nn and tt ( 1<=n<=2000001<=n<=200000 , 1<=t<=1091<=t<=10^{9} ) — the length of Efim's grade and the number of seconds till the end of the break respectively.

The second line contains the grade itself. It's guaranteed that the grade is a positive number, containing at least one digit after the decimal points, and it's representation doesn't finish with 00 .

输出格式

Print the maximum grade that Efim can get in tt seconds. Do not print trailing zeroes.

输入输出样例

  • 输入#1

    6 1
    10.245
    

    输出#1

    10.25
    
  • 输入#2

    6 2
    10.245
    

    输出#2

    10.3
    
  • 输入#3

    3 100
    9.2
    

    输出#3

    9.2
    

说明/提示

In the first two samples Efim initially has grade 10.24510.245 .

During the first second Efim can obtain grade 10.2510.25 , and then 10.310.3 during the next second. Note, that the answer 10.3010.30 will be considered incorrect.

In the third sample the optimal strategy is to not perform any rounding at all.

首页