Consider the set of all rectangles with a given area $S$. 
Find the largest value o  $ M = \frac{S}{2S+p + 2}$ where $p$ is the perimeter of the rectangle.
1. Let \( a \) be one of the rectangle's sides. Then the other side must be \( \frac{S}{a} \) since the area \( S \) is given by \( a \times \frac{S}{a} = S \).

2. The perimeter \( p \) of the rectangle is given by:
   \[
   p = 2a + 2\frac{S}{a}
   \]

3. We need to find the maximum value of:
   \[
   M = \frac{S}{2S + p + 2}
   \]

4. Substitute \( p \) into the expression for \( M \):
   \[
   M = \frac{S}{2S + 2a + 2\frac{S}{a} + 2}
   \]

5. Simplify the expression:
   \[
   M = \frac{S}{2S + 2a + 2\frac{S}{a} + 2} = \frac{1}{2} \cdot \frac{S}{S + a + \frac{S}{a} + 1}
   \]

6. Further simplify by dividing the numerator and the denominator by \( S \):
   \[
   M = \frac{1}{2} \cdot \frac{1}{1 + \frac{a}{S} + \frac{S}{aS} + \frac{1}{S}} = \frac{1}{2} \cdot \frac{1}{1 + \frac{a}{S} + \frac{1}{a} + \frac{1}{S}}
   \]

7. To maximize \( M \), we need to minimize the denominator \( 1 + \frac{a}{S} + \frac{1}{a} + \frac{1}{S} \). Notice that the expression \( \frac{a}{S} + \frac{1}{a} \) is minimized when \( a = \sqrt{S} \) by the AM-GM inequality:
   \[
   \frac{a}{S} + \frac{1}{a} \geq 2\sqrt{\frac{a}{S} \cdot \frac{1}{a}} = 2\sqrt{\frac{1}{S}}
   \]

8. Therefore, the minimum value of \( 1 + \frac{a}{S} + \frac{1}{a} + \frac{1}{S} \) is:
   \[
   1 + 2\sqrt{\frac{1}{S}} + \frac{1}{S}
   \]

9. Substitute \( a = \sqrt{S} \) into the expression for \( M \):
   \[
   M \leq \frac{1}{2} \cdot \frac{1}{1 + 2\sqrt{\frac{1}{S}} + \frac{1}{S}} = \frac{1}{2} \cdot \frac{1}{(1 + \frac{1}{\sqrt{S}})^2}
   \]

10. Simplify the expression:
    \[
    M \leq \frac{1}{2} \cdot \frac{1}{(1 + \frac{1}{\sqrt{S}})^2}
    \]

11. We can also prove this by considering the properties of rectangles. To maximize \( M \), we need to minimize \( p \). The minimum perimeter for a given area \( S \) is achieved when the rectangle is a square. For a square with side length \( \sqrt{S} \), the perimeter is:
    \[
    p = 4\sqrt{S}
    \]

12. Substitute \( p = 4\sqrt{S} \) into the expression for \( M \):
    \[
    M = \frac{S}{2S + 4\sqrt{S} + 2} = \frac{S}{2(\sqrt{S} + 1)^2}
    \]

13. This confirms that the maximum value of \( M \) is:
    \[
    M = \frac{1}{2} \cdot \frac{1}{(1 + \frac{1}{\sqrt{S}})^2}
    \]

The final answer is \( \boxed{ \frac{S}{2(\sqrt{S} + 1)^2} } \)