#include <iostream>

typedef struct {
    double width;
    double height;
}Rectangle;

template<typename T>
double sum_array(T arr[], int size) {
    double sum = 0;
    for (int i = 0; i < size; ++i) {
        sum += arr[i];
    }
    return sum;
}

template<>
double sum_array<Rectangle>(Rectangle arr[], int size) {
    double total_area = 0;
    for (int i = 0; i < size; ++i) {
        total_area += arr[i].width * arr[i].height;
    }
    return total_area;
}

int main() {
    Rectangle rectangles[] = {{2, 3}, {4, 5}, {1, 6}};
    std::cout << "Общая площадь прямоугольников: " << sum_array(rectangles, 3) << std::endl;

    return 0;
}
