yaworsw/euler-manager

View on GitHub
data/problems/236.yml

Summary

Maintainability
Test Coverage
---
:id: 236
:name: Luxury Hampers
:url: https://projecteuler.net/problem=236
:content: "Suppliers 'A' and 'B' provided the following numbers of products for the
  luxury hamper market:\n\n<center><table class=\"p236\">\n<tr>\n<th>Product</th>\n<th
  style=\"text-align:center;\">'A'</th>\n<th style=\"text-align:center;\">'B'</th>\n</tr>\n<tr>\n<td>Beluga
  Caviar</td>\n<td>5248</td>\n<td>640</td>\n</tr>\n<tr>\n<td>Christmas Cake</td>\n<td>1312</td>\n<td>1888</td>\n</tr>\n<tr>\n<td>Gammon
  Joint</td>\n<td>2624</td>\n<td>3776</td>\n</tr>\n<tr>\n<td>Vintage Port</td>\n<td>5760</td>\n<td>3776</td>\n</tr>\n<tr>\n<td>Champagne
  Truffles</td>\n<td>3936</td>\n<td>5664</td>\n</tr>\n</table></center>\n\nAlthough
  the suppliers try very hard to ship their goods in perfect condition, there is inevitably
  some spoilage - _i.e._ products gone bad.\n\nThe suppliers compare their performance
  using two types of statistic:\n\n- The five _per-product spoilage rates_ for each
  supplier are equal to the number of products gone bad divided by the number of products
  supplied, for each of the five products in turn.\n- The _overall spoilage rate_
  for each supplier is equal to the total number of products gone bad divided by the
  total number of products provided by that supplier.\n\nTo their surprise, the suppliers
  found that each of the five per-product spoilage rates was worse (higher) for 'B'
  than for 'A' by the same factor (ratio of spoilage rates), <var>m</var>\\>1; and
  yet, paradoxically, the overall spoilage rate was worse for 'A' than for 'B', also
  by a factor of <var>m</var>.\n\nThere are thirty-five <var>m</var>\\>1 for which
  this surprising result could have occurred, the smallest of which is 1476/1475.\n\nWhat's
  the largest possible value of <var>m</var>?  \nGive your answer as a fraction reduced
  to its lowest terms, in the form <var>u</var>/<var>v</var>.\n\n"