[TASK]:
You will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.

[INSTRUCTION]:
The following libraries are already included in the code.
```cpp
#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <fstream>
#include <climits>
#include <cassert>
#include <iomanip>
#include <sstream>
#include <bitset>
using namespace std;
```
Do not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.

[PSEUDOCODE]:
Grades = char array of size 200005
define the main function
    let lfp, zp, n, i, t, last be integers with lfp = -1
    let carryFlag, pf be boolean with carryFlag = false, pf = false
    read n, t, Grades[1]
    for i = 1 to n inclusive
        if Grades[i] == '.'
            increment i
            break out of for loop
        end of the block
    end of the block
    while Grades[i] and t > 0
        if Grades[i] is greater than or equal to '5'
            set lfp to i
            break
        end of the block
        increment i
    end of the block
    while (-lfp) is not zero and t > 0 and pf is false
        if Grades[lfp - 1] == '.'
            set Grades[lfp - 1] to 0
            increment Grades[lfp - 2]
            update last to lfp - 2
            set pf to true
        else
            update Grades[lfp] to 0
            increment Grades[lfp - 1]
            update last to lfp - 1
        end of the block
        set lfp to -1
        decrement t
        if Grades[last] > '9'
            let c be integer with c = 1
            set Grades[last] to '0'
            decrement last
            while c is not zero
                set c to 0
                if Grades[last] == '.'
                    set Grades[last] to '\0'
                    increment Grades[last - 1]
                    decrement last by 2
                    set pf to true
                else if last == '\0'
                    set carryFlag to true
                    set Grades[0] to '1'
                    break
                else
                    increment Grades[last]
                end of the block
                if Grades[last] > '9'
                    if not pf
                        set Grades[last] to '\0'
                    else
                        set Grades[last] to '0'
                    decrement last
                    set c to 1
                end of the block
                if Grades[last] >= '5', set lfp to last
            end of the block
        else if Grades[last] >= '5'
            set lfp to last
        end of the block
    end of the block
    if carryFlag is true
        print out first element of Grades
    else
        print out second element of Grades
    return to indicate successful execution
end of the block

[CODE]:

char Grades[200005];
int main() {
    int lfp = -1, zp, n, i, t, last;
    bool carryFlag = false, pf = false;
    cin >> n >> t >> (Grades + 1);
    for (i = 1; i <= n; ++i) {
        if (Grades[i] == '.') {
            ++i;
            break;
        }
    }
    while (Grades[i] && t > 0) {
        if (Grades[i] >= '5') {
            lfp = i;
            break;
        }
        ++i;
    }
    while ((~lfp) && t > 0 && !pf) {
        if (Grades[lfp - 1] == '.') {
            Grades[lfp - 1] = 0;
            Grades[lfp - 2]++;
            last = lfp - 2;
            pf = true;
        } else {
            Grades[lfp] = 0;
            Grades[lfp - 1]++;
            last = lfp - 1;
        }
        lfp = -1;
        t--;
        if (Grades[last] > '9') {
            int c = 1;
            Grades[last] = '0';
            last--;
            while (c) {
                c = 0;
                if (Grades[last] == '.') {
                    Grades[last] = '\0';
                    Grades[last - 1]++;
                    last -= 2;
                    pf = true;
                } else if (last == '\0') {
                    carryFlag = true;
                    Grades[0] = '1';
                    break;
                } else {
                    Grades[last]++;
                }
                if (Grades[last] > '9') {
                    if (!pf)
                        Grades[last] = '\0';
                    else
                        Grades[last] = '0';
                    last--;
                    c = 1;
                }
                if (Grades[last] >= '5') lfp = last;
            }
        } else if (Grades[last] >= '5') {
            lfp = last;
        }
    }
    if (carryFlag)
        cout << Grades << endl;
    else
        cout << (Grades + 1) << endl;
    return 0;
}