Complete the code below for this task:
Task:
Develop class Polynomial. The internal representation of a Polynomial is an array of terms. Each term contains a coefficient and an exponent—e.g., the term 2x^4 has the coefficient 2 and the exponent 4. Develop a complete class containing proper constructor and destructor functions as well as set and get functions. The class should also provide the following overloaded capabilities:

Overload the addition operator (+) to add two polynomials.
Overload the subtraction operator (-) to subtract two polynomials.
Overload the assignment operator to assign one polynomial to another.
Overload the multiplication operator (*) to multiply two polynomials.
Overload the addition assignment operator (+=), subtraction assignment operator (-=), and multiplication assignment operator (*=).
Code (Add namespace):
```
// Polynomial.h
// Defines the Polynomial class

#ifndef POLYNOMIAL_H
#define POLYNOMIAL_H
#include <iostream>
#include <vector>

class Polynomial {
private:
    std::vector<std::pair<int, int>> terms; // Stores terms as pairs (coefficient, exponent)
    
public:
    // Constructors
    Polynomial();
    Polynomial(const std::vector<std::pair<int, int>>& terms);
    
    // Destructor
    ~Polynomial();
    
    // Getter and Setter
    const std::vector<std::pair<int, int>>& getTerms() const;
    void setTerms(const std::vector<std::pair<int, int>>& terms);
    
    // Overloaded Operators
    Polynomial operator+(const Polynomial& other) const;
    Polynomial operator-(const Polynomial& other) const;
    Polynomial operator*(const Polynomial& other) const;
    Polynomial& operator=(const Polynomial& other);
    Polynomial& operator+=(const Polynomial& other);
    Polynomial& operator-=(const Polynomial& other);
    Polynomial& operator*=(const Polynomial& other);
};
#endif

// Polynomial.cpp
// Implements the Polynomial class

#include "Polynomial.h"

// Constructors
Polynomial::Polynomial() {}
Polynomial::Polynomial(const std::vector<std::pair<int, int>>& terms) : terms(terms) {}

// Destructor
Polynomial::~Polynomial() {}

// Getter and Setter
const std::vector<std::pair<int, int>>& Polynomial::getTerms() const {
    return terms;
}

void Polynomial::setTerms(const std::vector<std::pair<int, int>>& terms) {
    this->terms = terms;
}

// Overloaded Operators
Polynomial Polynomial::operator+(const Polynomial& other) const {
    // Implement addition logic here
}

Polynomial Polynomial::operator-(const Polynomial& other) const {
    // Implement subtraction logic here
}

Polynomial& Polynomial::operator=(const Polynomial& other) {
    if (this != &other) {
        // Implement assignment logic here
    }
    return *this;
}

Polynomial Polynomial::operator*(const Polynomial& other) const {
    // Implement multiplication logic here
}

Polynomial& Polynomial::operator+=(const Polynomial& other) {
    // Implement addition assignment logic here
}

Polynomial& Polynomial::operator-=(const Polynomial& other) {
    // Implement subtraction assignment logic here
}

Polynomial& Polynomial::operator*=(const Polynomial& other) {
    // Implement multiplication assignment logic here
}

#include <iostream>
#include <iomanip>      
#include "Polynomial.h"

using namespace std;

int main() {
    
    int max_degree = 6; // Maximum degree of a polynomial
    int num_terms1, num_terms2;
    
    // Input for the first polynomial
    std::cout << "Enter the number of polynomial terms for the first polynomial: ";
    std::cin >> num_terms1;
    Polynomial poly1(max_degree);
    std::cout << "Enter coefficient and exponent for each term:" << std::endl;
    
    for (int i = 0; i < num_terms1; i++) {
        int coef, exp;
        std::cin >> coef >> exp;
        poly1.setTerm(coef, exp);
    }
    
    // Input for the second polynomial
    std::cout << "Enter the number of polynomial terms for the second polynomial: ";
    std::cin >> num_terms2;
    Polynomial poly2(max_degree);
    std::cout << "Enter coefficient and exponent for each term:" << std::endl;
    
    for (int i = 0; i < num_terms2; i++) {
        int coef, exp;
        std::cin >> coef >> exp;
        poly2.setTerm(coef, exp);
    }
    // Display the input polynomials
    std::cout << "First Polynomial is:" << std::endl;
    std::cout << poly1 << std::endl;
    std::cout << "Second Polynomial is:" << std::endl;
    std::cout << poly2 << std::endl;
    
    // Perform polynomial operations
    Polynomial result;
    result = poly1 + poly2;
    std::cout << "Adding polynomials yields:" << std::endl;
    std::cout << result << std::endl;
    result = poly1 - poly2;
    std::cout << "Subtracting polynomials yields:" << std::endl;
    std::cout << result << std::endl;
    result = poly1 * poly2;
    std::cout << "Multiplying polynomials yields:" << std::endl;
    std::cout << result << std::endl;
    
    return 0;
}
```