#include <iostream>
#include <cmath>
using namespace std;

int xc = 20;
int yc = 15;
int r = 10;

void plot(int x, int y)
{
    cout << "(" << x << ", " << y << ") ";
}

void midpointCircle()
{
    int x = 0;
    int y = r;
    int p = 1 - r;

    while (x <= y)
    {
        plot(xc + x, yc + y);
        plot(xc - x, yc + y);
        plot(xc + x, yc - y);
        plot(xc - x, yc - y);

        plot(xc + y, yc + x);
        plot(xc - y, yc + x);
        plot(xc + y, yc - x);
        plot(xc - y, yc - x);

        cout << endl;

        if (p < 0)
        {
            p = p + 2 * x + 3;
        }
        else
        {
            p = p + 2 * (x - y) + 5;
            y--;
        }

        x++;
    }
}

int main()
{
    cout << "Midpoint Circle Drawing Algorithm\n";
    cout << "Center = (" << xc << ", " << yc << ")\n";
    cout << "Radius = " << r << "\n\n";

    midpointCircle();

    return 0;
}