#include <bits/stdc++.h>
using namespace std;
int n, t, k;
string s;
string res(int l);
string solve(string& s);
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> t >> s;
  cout << solve(s) << endl;
  return 0;
}
string solve(string& s) {
  k = 0;
  while (s[k] != '.') ++k;
  bool fl = true;
  for (int i = k + 1; i < n; ++i) {
    if (s[i] > '4') fl = false;
  }
  if (fl) return s;
  int l = k + 1;
  while (s[l] < '4') ++l;
  if (s[l] > '4') return res(l);
  vector<int> v(n, 0);
  for (int i = s.length() - 1; i > k; --i) {
    if (s[i] > '4')
      v[i] = 1;
    else if (s[i] == '4') {
      if (i < s.length() - 1 && v[i + 1] != 0) v[i] = v[i + 1] + 1;
    }
  }
  for (int i = l; i < n; ++i) {
    if (v[i] > 0 && v[i] <= t) return res(i);
  }
}
string res(int l) {
  string t;
  int len;
  if (l == k + 1) {
    t = "0" + s.substr(0, k);
    len = t.length();
    t[len - 1] += 1;
    for (int i = len - 1; i > 0; --i) {
      if (t[i] > '9') {
        t[i] = '0';
        t[i - 1] += 1;
      }
    }
    if (t[0] == '0')
      return t.substr(1, len - 1);
    else
      return t;
  }
  t = s.substr(0, l);
  len = t.length();
  t[len - 1] += 1;
  return t;
}
