#include <iostream>
#include <random>
#include <map>
#include <iomanip>
int main()
{
const int nrolls = 10000; // number of experiments
std::default_random_engine generator;
std::uniform_int_distribution<int> distribution(Min, Max);
std::map<int, int> histogram;
for (int i = 0; i < nrolls; i++) {
int number = distribution(generator);
++histogram[number];
}
for (auto p : histogram) {
std::cout << std::fixed << std::setprecision(1) << std::setw(2)
<< p.first << ' ' << std::string(p.second/(nrolls/(10*(Max-Min))), '*') << '\n';
}
return 0;
}
CiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPHJhbmRvbT4KCiNpbmNsdWRlIDxtYXA+CiNpbmNsdWRlIDxpb21hbmlwPgoKaW50IG1haW4oKQp7CiAgY29uc3QgaW50IG5yb2xscyA9IDEwMDAwOyAvLyBudW1iZXIgb2YgZXhwZXJpbWVudHMKCgogIHN0ZDo6ZGVmYXVsdF9yYW5kb21fZW5naW5lIGdlbmVyYXRvcjsKCiAgc3RkOjp1bmlmb3JtX2ludF9kaXN0cmlidXRpb248aW50PiBkaXN0cmlidXRpb24oTWluLCBNYXgpOwoKCiAgCiAgc3RkOjptYXA8aW50LCBpbnQ+IGhpc3RvZ3JhbTsKICBmb3IgKGludCBpID0gMDsgaSA8IG5yb2xsczsgaSsrKSB7CiAgICBpbnQgbnVtYmVyID0gZGlzdHJpYnV0aW9uKGdlbmVyYXRvcik7CiAgICArK2hpc3RvZ3JhbVtudW1iZXJdOwogIH0KCiAgZm9yIChhdXRvIHAgOiBoaXN0b2dyYW0pIHsKICAgIHN0ZDo6Y291dCA8PCBzdGQ6OmZpeGVkIDw8IHN0ZDo6c2V0cHJlY2lzaW9uKDEpIDw8IHN0ZDo6c2V0dygyKQogICAgICAgICAgICAgIDw8IHAuZmlyc3QgPDwgJyAnIDw8IHN0ZDo6c3RyaW5nKHAuc2Vjb25kLyhucm9sbHMvKDEwKihNYXgtTWluKSkpLCAnKicpIDw8ICdcbic7CiAgfQogIHJldHVybiAwOwp9