[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]:
let Pi be a constant double with value is equal to arc cosine of (-1.0)
define the main function
    let k be a integer
    read k
    print +------------------------+ and newline
    print |
    if (k is greater than 0)
        print O.
    else do the following
        print #.
    let c be a integer with value c is equal to (k - 4) / 3
    if ((k - 4) modulus 3 is greater than 0), increase c by 1
    for ( i =0 to 10 exclusive )
        if (i is less than c)
            print O.
        else do the following
            print #.
    end of the block
    print |D| and newline
    print |
    if (k is greater than 1)
        print O.
    else do the following
        print #.
    let the value of c is equal to (k - 4) / 3
    if ((k - 4) modulus 3 is greater than 1), increase c value by 1
    for ( i = 0 to 10 exclusive )
        if (i is less than c)
            print O.
        else, do the following
            print #.
    end of the block
    print |.| and newline
    print |
    if (k is greater than 2)
        print O
    else do the following
        print #
    print .......................| and newline
    print |
    if (k is greater than 3)
        print O.
    else do the following
        print #.
    let the value of c is equal to (k - 4) / 3
    for ( i =0 to 10 exclusive )
        if (i is less than c)
            print O.
        else do the following
            print #.
    end of the block
    print |.| and newline
    print +------------------------+ and newline
    return to indicate successful execution
end of the block

[CODE]:

const double Pi = acos(-1.0);
int main() {
    int k;
    cin >> k;
    cout << "+------------------------+\n";
    cout << "|";
    if (k > 0)
        cout << "O.";
    else
        cout << "#.";
    int c = (k - 4) / 3;
    if ((k - 4) % 3 > 0) c++;
    for (int i = 0; i < 10; i++) {
        if (i < c)
            cout << "O.";
        else
            cout << "#.";
    }
    cout << "|D|)\n";
    cout << "|";
    if (k > 1)
        cout << "O.";
    else
        cout << "#.";
    c = (k - 4) / 3;
    if ((k - 4) % 3 > 1) c++;
    for (int i = 0; i < 10; i++) {
        if (i < c)
            cout << "O.";
        else
            cout << "#.";
    }
    cout << "|.|\n";
    cout << "|";
    if (k > 2)
        cout << "O";
    else
        cout << "#";
    cout << ".......................|\n";
    cout << "|";
    if (k > 3)
        cout << "O.";
    else
        cout << "#.";
    c = (k - 4) / 3;
    for (int i = 0; i < 10; i++) {
        if (i < c)
            cout << "O.";
        else
            cout << "#.";
    }
    cout << "|.|)\n";
    cout << "+------------------------+\n";
    return 0;
}