#include <iostream>
#include <functional>
#include <chrono>
#include <random>
using namespace std;
int main()
{
auto seed = chrono::system_clock::now().time_since_epoch().count();
auto engine = default_random_engine{seed};
auto dice = uniform_int_distribution<int>{1,6};
auto d12 = uniform_int_distribution<int>{1,12};
auto roll = bind( dice, engine );
auto roll12 = bind( d12, engine );
for(int i = 0; i < 100; ++i)
{
cout << roll() << "\n";
cout << roll12() << "\n\n";
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8ZnVuY3Rpb25hbD4KI2luY2x1ZGUgPGNocm9ubz4KI2luY2x1ZGUgPHJhbmRvbT4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKIAppbnQgbWFpbigpIAp7CglhdXRvIHNlZWQgICA9IGNocm9ubzo6c3lzdGVtX2Nsb2NrOjpub3coKS50aW1lX3NpbmNlX2Vwb2NoKCkuY291bnQoKTsKCWF1dG8gZW5naW5lID0gZGVmYXVsdF9yYW5kb21fZW5naW5le3NlZWR9OwoJYXV0byBkaWNlICAgPSB1bmlmb3JtX2ludF9kaXN0cmlidXRpb248aW50PnsxLDZ9OwoJYXV0byBkMTIgICAgPSB1bmlmb3JtX2ludF9kaXN0cmlidXRpb248aW50PnsxLDEyfTsKCWF1dG8gcm9sbCAgID0gYmluZCggZGljZSwgZW5naW5lICk7CglhdXRvIHJvbGwxMiA9IGJpbmQoICBkMTIsIGVuZ2luZSApOwoJCglmb3IoaW50IGkgPSAwOyBpIDwgMTAwOyArK2kpCgl7CgkJY291dCA8PCByb2xsKCkgICA8PCAiXG4iOwoJCWNvdXQgPDwgcm9sbDEyKCkgPDwgIlxuXG4iOwoJfQoJcmV0dXJuIDA7Cn0=