#include <iostream>
#include <vector>
#include <cmath>


/// Базовый класс "Геометрическая фигура"
class Shape {
public:
    virtual double area() const = 0; // Чистый виртуальный метод
    virtual double perimeter() const = 0;
};

/// Производный класс "Прямоугольник"
class Rectangle : public Shape {
protected:
    double width, height;
public:
    Rectangle(double w, double h) : width(w), height(h) {}
    double area() const override { return width * height; }
    double perimeter() const override { return 2 * (width + height); }
};

/// Производный класс "Квадрат"
class Square : public Rectangle {
public:
    Square(double side) : Rectangle(side, side) {}
};


class Rhombus : public Shape {
private:
    double side;  // Длина стороны
    double angle; // Угол между сторонами в градусах
public:
    Rhombus(double s, double a) : side(s), angle(a) {}

    double area() const override {
        double angleInRadians = angle * M_PI / 180.0;
        return side * side * std::sin(angleInRadians);
    }

    double perimeter() const override {
        return 4 * side;
    }
};





int main(){  
    std::vector<Shape*> shapes;

    shapes.push_back(new Rectangle(5.0, 3.0));
    shapes.push_back(new Square(4.0));
    shapes.push_back(new Rhombus(6.0, 60.0));

    for (const auto& shape : shapes) {
        std::cout << "\n######################\n";
        std::cout << "Arena: \n" <<shape->area();
        std::cout << "\nperimeter: \n" << shape->perimeter();
    }

    for (auto& shape : shapes) {
        delete shape;
    }

    return 0;

}