#include <bits/stdc++.h>
using namespace std;
long long int n, m, ar[1000005], sum, flag;
char s[1000005];
priority_queue<int> pq;
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  cin >> s + 1;
  int flag = 0;
  int nokta;
  for (int i = 1; i <= n; i++) {
    if (s[i] == '.') nokta = i;
  }
  for (int i = nokta; i < n; i++) {
    s[i] = s[i + 1];
    if (s[i] >= '5') pq.push(-i);
  }
  s[0] = '0';
  n--;
  while (pq.size() && m) {
    long long int x = -pq.top();
    pq.pop();
    if (x == 0) continue;
    if (x < nokta && s[x] == '9') {
      s[x] = '0', s[x - 1]++;
      if (s[x - 1] == '9') pq.push(x - 1);
    }
    if (x < nokta || x > n) continue;
    s[x] = '0';
    n = x - 1;
    m--;
    if (x == nokta) {
      flag = 1;
      n = nokta - 1;
      break;
    }
    s[x - 1]++;
    if (s[x - 1] >= '5') pq.push(-x + 1);
  }
  if (flag) {
    for (int i = nokta - 1; i >= 0; i--) {
      if (s[i] == '9')
        s[i] = '0';
      else {
        s[i]++;
        break;
      }
    }
  }
  if (s[0] > '0') cout << s[0];
  for (long long int i = 1; i <= nokta - 1; i++) cout << s[i];
  if (nokta <= n) cout << '.';
  for (long long int i = nokta; i <= n; i++) cout << s[i];
}
