# Solution:

Since the prices must be the same for the faculties, Hermione Monopolist must take into account the aggregate demand for badges, which is given by:

$$
Q(P)=q_{w s}+q_{s}=\left\{\begin{array}{l}
26-2 P, P \geq 13 \\
36-3 P, P<13
\end{array}\right.
$$

Then the marginal revenue of Hermione's monopoly is given by:

$$
M R(Q)=(P(Q) Q)^{\prime}=\left\{\begin{array}{c}
13-Q, Q \leq 6 \\
12-2 Q / 3, Q>6
\end{array}\right.
$$

Since the marginal revenue of Hermione's monopoly is decreasing, and the marginal costs are increasing, the maximum profit of Hermione's enterprise will be achieved when $M R\left(Q^{*}\right)=M C\left(Q^{*}\right)$. Thus, we get

$$
\begin{aligned}
& M R\left(Q^{*}\right)=M C\left(Q^{*}\right) \\
& \rightarrow\left\{\begin{array}{l}
13-Q=10 Q, \quad Q=13 / 11 \leq 6 \\
12-\frac{2 Q}{3}=10 Q, \quad Q=\frac{9}{8}, \text { which does not satisfy the condition } Q>6
\end{array}\right.
\end{aligned}
$$

Thus, only students from all faculties except Slytherin will buy the product.

In this case, $\frac{13}{11}$ units of the product will be sold at a price of $P=13-\frac{13}{22}=\frac{273}{22}$

It should be noted that the problem does not specify the units in which the quantity of badges is measured (for example, it could be pairs, tens, dozens, etc.).

Then the Association will earn $\frac{13}{11} * \frac{273}{22}-5 *\left(\frac{13}{11}\right)^{2} \approx 7.682$

## Criteria:

15 points for a fully justified solution.

10 points for a solution with incomplete justification. (The most common deficiency: the participant did not explain on which segment of the piecewise-defined demand to look for the solution to the optimization problem.)

5 points for an incomplete solution. (The most common deficiencies: the participant solved the problem by trying integer values of quantity, the participant did not take into account that the aggregate demand for badges is a piecewise-defined function.) 0 points for an incorrect solution.

The lack of justification for the sufficiency of the conditions for obtaining the maximum of the function was penalized by 1 point.

Rounding the final answer to an integer value is penalized by 1 point.
6. In her fourth year at Hogwarts, Hermione was outraged by the infringement of house-elf rights and founded the Association for the Restoration of Elven Independence. Of course, even the brightest and noblest idea requires funding for promotion, so Hermione decided to finance her campaign by producing merchandise, starting with the production of badges. Everyone at Hogwarts liked this idea, and Hermione secured the right to produce such badges by obtaining the relevant patent. Ron, who has known the nuances of magical technologies since childhood, convinced Hermione that the cost of producing badges would be $T C(Q)=5 Q^{2}$, where $Q$ is the number of badges produced. Harry, with the help of his friends and the time-turner potion, found out that the demand for badges from students of all houses except Slytherin can be represented by the demand function $q_{w s}=26-2 P$, and from Slytherin by the demand function $q_{s}=10-P$ (Slytherin students are prejudiced against ideas from Gryffindors, especially those of Muggle descent, but would not refuse to support the Association). What is the maximum amount Hermione can earn for her company by selling badges if the prices of the same product for different Hogwarts houses must be the same?