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

class Vector {
	size_t size; 
	double *elem; 
public:
   Vector(initializer_list<double> lst)
    :size{lst.size()},elem{new double[lst.size()]}
    {
        std::copy(lst.begin(),lst.end(),elem);
    }
    void test() { for (int i=0; i<size; i++) cout<< elem[i]<<" "; cout<<endl; }
};

class Matrix{
private:
    int row;
    int col;
    double **elem;
public:
    //Default Constructor:
    Matrix(int row,int col) { cout << "Other !!"<<endl; }
    //Initialized list constructor:
    Matrix(initializer_list<initializer_list<double>> lst) : row{lst.size()},col{0} {
        for (auto &x: lst) 
            if (x.size()>col)
                col = x.size();
        cout<<row<<"x"<<col<<endl; 
        elem=new double*[row]; 
        auto it=lst.begin(); 
        for (int i=0; i<row; i++, it++) {
        	elem[i]=new double[col];
        	std::copy(it->begin(),it->end(),elem[i]);
        }
    }
    void test() { 
        for (size_t i=0; i<row; i++) {
        	for (size_t j=0; j<col; j++) 
        	   cout<< elem[i][j]<<" "; 
        	cout<<endl; 
        }
    }
};

int main() {
	Vector v{1,2,3,4,5,6,7,8,9,10,11}; 
	v.test(); 
	Matrix m{ {1,2,3},{4,5,6},{7,8,9}}; 
	m.test();
	Matrix l{1,2};
	return 0;
}