#include<iostream>
#include<cmath>
#define PI 3.1415
using namespace std;

class Object3D{
   public:
   Object3D()
   {
       ;
   }
  
   virtual double getVolume() = 0;
   virtual void print() = 0;
};

class Sphere:public Object3D{
   public:
   double radius;
   Sphere(double radius)
   {
       this->radius = radius;
   }
  
   double getVolume()
   {
       double volume = ((float)4/(float)3)*PI* pow(radius,3);
       return volume;
   }
  
   void print()
   {
       cout<<"Sphere: r="<<radius<<endl;
       cout<<"Volume= "<<getVolume()<<endl<<endl;
   }
};

class Cylinder:public Object3D{
   public:
   double radius,height;
   Cylinder(double radius,double height)
   {
       this->radius = radius;
       this->height = height;
   }
  
   double getVolume()
   {
       double volume = PI* pow(radius,2)*height;
       return volume;
   }
  
   void print()
   {
       cout<<"Cylinder: r="<<radius<<", h="<<height<<endl;
       cout<<"Volume= "<<getVolume()<<endl<<endl;
   }
};

class Cuboid:public Object3D{
   public:
   double width,length,height;
   Cuboid(double width,double length,double height)
   {
       this->width = width;
       this->length = length;
       this->height = height;
   }
  
   double getVolume()
   {
       double volume = width*length*height;
       return volume;
   }
  
   void print()
   {
       cout<<"Cuboid: dimension= "<<width<<" x "<<length<<" x "<<height<<endl;
       cout<<"Volume= "<<getVolume()<<endl<<endl;
   }
};

int main()
{
   double total = 0;
   cout<<"Object #1\n";
   Cuboid c1(10,20,30);
   c1.print();
   total+=c1.getVolume();
  
   cout<<"Object #2\n";
   Cylinder c2(20,20);
   c2.print();
   total+=c2.getVolume();
  
   cout<<"Object #3\n";
   Sphere s1(10);
   s1.print();
   total+=s1.getVolume();
  
   cout<<"Object #4\n";
   Cylinder c3(2,5);
   c3.print();
   total+=c3.getVolume();
  
   cout<<"Object #5\n";
   Sphere s2(3);
   s2.print();
   total+=s2.getVolume();
   cout<<"Total Volume = "<<total;
}
