A system has $n$ resources $R_0, \dots,R_{n-1}$, and $k$ processes $P_0, \dots, P_{k-1}$. The implementation of the resource request logic of each process $P_i$ is as follows:
$\text{if} (i\%2==0) \{$
$\quad\text{if} (i<n) \text{ request } R_i;$
$\quad\text{if} (i+2 < n) \text{ request } R_{i+2}; \}$
$\text{else} \{$
$\quad\text{if} (i<n) \text{ request } R_{n-i};$
$\quad\text{if} (i+2 <n) \text{ request } R_{n-i-2}; \}$
In which of the following situations is a deadlock possible?
- $n=40,\: k=26$
- $n=21,\:k=12$
- $n=20,\:k=10$
- $n=41,\:k=19$