#include <iostream>
#include <vector>
#include "histogram.h"
#include "text.h"
struct Input{
    std::vector<double> numbers;
    size_t bin_count{};
};

Input input_data(istream& in) {
    size_t number_count;
    std::cerr << "Enter number count: ";
    in >> number_count;

    std::cerr << "Enter numbers: \n";
    Input local;
    in.numbers.resize(number_count);
    for (size_t i = 0; i < number_count; ++i) {
        in >> local.numbers[i];
    }

    std::cerr << "Enter bucket: ";
    in >> local.bin_count;

    return local;
};

using namespace std;

int main() {
    Input in = input_data(cin);
    auto bins = make_histogram(in.numbers, in.bin_count);
    show_histogram_svg(bins);
    return 0;
}
