#include <bits/stdc++.h>
using namespace std;
int n, k;
int s[200001];
int rak[2000001];
int main() {
  int n, k;
  scanf("%d%d\n", &n, &k);
  char zn;
  int dl = 0;
  int dlrak = 0;
  for (int i = 0; i < n; ++i) {
    zn = getchar();
    if (zn == '.')
      break;
    else
      rak[dlrak++] = zn - '0';
  }
  for (int i = dlrak + 1; i < n; ++i) {
    zn = getchar();
    s[dl++] = (zn - '0');
    if (zn > '4') break;
  }
  if (dlrak == n) {
    for (int i = 0; i < dlrak; ++i) {
      printf("%d", rak[i]);
    }
    return 0;
  }
  reverse(s, s + dl);
  int last_cut = -1;
  for (int i = 0; i < dl; ++i) {
    if (s[i] > 9)
      s[i + 1]++, last_cut = i;
    else if (s[i] > 4 && k)
      s[i + 1]++, last_cut = i, --k;
  }
  reverse(rak, rak + dlrak);
  if (s[dl]) rak[0]++;
  for (int i = 0; i < dlrak; ++i) {
    if (rak[i] > 9) rak[i + 1]++, rak[i] = 0;
    if (i == dlrak - 1 && rak[dlrak]) ++dlrak;
  }
  for (int i = dlrak - 1; i >= 0; --i) printf("%d", rak[i]);
  if (dl - 1 > last_cut) printf(".");
  for (int i = dl - 1; i > last_cut; --i) printf("%d", s[i]);
  return 0;
}
