#include <iostream>
#include <cstdlib>
#include <ctime>

using namespace std;

struct OddsEntry
{
	int multiplier;
	int threshold;
};

OddsEntry RollThresholds[] =
{
	{ 4, 5 },
	{ 8, 6 },
	{ 16, 7 },
	{ 32, 8 },
	{ 64, 9 }
};

int RollD10()
{
	float random = (float(rand()) / RAND_MAX) * 10.f;
	return(int(random));
}

int main() {
	srand(time(0));
	static constexpr int Iterations = 5000000;
	for(const OddsEntry& entry : RollThresholds)
	{
		cout << "For multiplier " << entry.multiplier << "X, little one wins ";
		int wins = 0;
		for(int iteration = 0; iteration < Iterations; ++iteration)
		{
			int littleScore = 0;
			int bigScore = 0;
			while((littleScore < 6) && (bigScore < 6))
			{
				const int roll = RollD10();
				const int increment = (RollD10() < 6) ? 1 : 2;
				if(roll < entry.threshold)
				{
					bigScore += increment;
				}
				else
				{
					littleScore += increment;
				}
			}
			if(littleScore >= 6)
			{
				wins++;
			}
		}
		cout << (float(wins) / Iterations) * 100.f << "%\n";
	}
	return 0;
}