#include <iostream>
#include <vector>
#include <memory>
#include <math.h>

using namespace std;

class Shape {
    float x, y;
public:
    virtual float area() = 0;
};

class Circle : public Shape {
    float radius;
public:
    Circle(float radius) : radius{radius} { }
    
    virtual float area() {
      return M_PI * radius * radius;
    }
};

class Rect : public Shape {
    float width;
    float height;
public:
	Rect(float width, float height) : width{width}, height{height} { }
	
    virtual float area() {
      return width * height;
    }
};

int main()
{
   vector<unique_ptr<Shape>> shapes;

   shapes.push_back(make_unique<Circle>(5));
   shapes.push_back(make_unique<Rect>(4,6));
   
   float total_area = 0;
   for(auto&& shape: shapes) {
   	total_area += shape->area();
   }
   cout << "Total area is " << total_area << endl;
   
   return 0;
}