#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
int main() {
  int n, t;
  cin >> n >> t;
  string s;
  cin >> s;
  int pos = -1;
  for (int i = 0; i < n; ++i)
    if (s[i] == '.') {
      pos = i;
      break;
    }
  if (pos == -1) {
    cout << s;
    return 0;
  }
  for (int i = 0; i < n; ++i)
    if (i != pos) s[i] -= '0';
  const int INF = 1e9;
  vector<vector<int>> dp(n, vector<int>(11, INF));
  dp[n - 1][s[n - 1]] = 0;
  for (int i = n - 2; i > pos; --i) {
    dp[i][s[i]] = 0;
    if (dp[i + 1][10] != INF) {
      dp[i][s[i] + 1] = min(dp[i][s[i] + 1], dp[i + 1][10]);
    }
    int res = INF;
    for (int j = 5; j < 10; ++j) res = min(res, dp[i + 1][j]);
    if (res < t) dp[i][s[i] + 1] = min(dp[i][s[i] + 1], res + 1);
  }
  dp[pos - 1][s[pos - 1]] = 0;
  if (dp[pos + 1][10] != INF) {
    dp[pos - 1][s[pos - 1] + 1] =
        min(dp[pos - 1][s[pos - 1] + 1], dp[pos + 1][10]);
  }
  int res = INF;
  for (int j = 5; j < 10; ++j) res = min(res, dp[pos + 1][j]);
  if (res < t)
    dp[pos - 1][s[pos - 1] + 1] = min(dp[pos - 1][s[pos - 1] + 1], res + 1);
  if (dp[pos - 1][10] != INF) {
    for (int i = 0; i < n; ++i)
      if (i != pos) s[i] += '0';
    s = s.substr(0, pos);
    int i = pos - 1;
    s[i] = '9';
    while (i >= 0 && s[i] == '9') {
      s[i] = '0';
      --i;
    }
    if (i == -1) {
      s = '1' + s;
    } else {
      ++s[i];
    }
    cout << s;
    return 0;
  }
  int good = -1;
  for (int j = 9; j > s[pos - 1]; --j)
    if (dp[pos - 1][j] != INF) {
      good = j;
      break;
    }
  if (good != -1) {
    for (int i = 0; i < pos; ++i) s[i] += '0';
    s = s.substr(0, pos);
    ++s[pos - 1];
    cout << s;
    return 0;
  }
  for (int i = 0; i < pos; ++i) s[i] += '0';
  cout << s.substr(0, pos);
  cout << '.';
  for (int i = pos + 1; i < n; ++i) {
    int found = -1;
    for (int j = 9; j > s[i]; --j)
      if (dp[i][j] != INF) {
        found = j;
        break;
      }
    if (found == -1) {
      cout << char(s[i] + '0');
      continue;
    }
    cout << char(s[i] + 1 + '0');
    return 0;
  }
}
