Step 1: Examine Set I \((Be,\ Mg)\).
Beryllium does not react with water because of its protective oxide film.
\[
Be \; \text{does not react with water}.
\]
Magnesium reacts only with hot water or steam.
Since both metals do not react readily with water,
\[
\boxed{\text{Set I is incorrect}}
\]
Step 2: Examine Set II \((Li,\ Mg)\).
Lithium reacts with cold water.
\[
2Li+2H_2O
\rightarrow
2LiOH+H_2
\]
Magnesium does not react with cold water appreciably.
\[
\boxed{\text{Set II is incorrect}}
\]
Step 3: Examine Set III \((Na,\ K)\).
Both sodium and potassium react vigorously with water.
\[
2Na+2H_2O
\rightarrow
2NaOH+H_2
\]
\[
2K+2H_2O
\rightarrow
2KOH+H_2
\]
\[
\boxed{\text{Set III is correct}}
\]
Step 4: Examine Set IV \((K,\ Ca)\).
Potassium reacts vigorously with water.
Calcium also reacts with cold water.
\[
Ca+2H_2O
\rightarrow
Ca(OH)_2+H_2
\]
\[
\boxed{\text{Set IV is correct}}
\]
Final Result:
The sets in which both metals react with water are
\[
\boxed{\text{III and IV only}}
\]
\[
\boxed{\text{Answer = (C)}}
\]