in this question 4 process wants 5 instances each,
so for avoiding deadlock, we have provide minimum 4 instances each and 1 shared instance,i.e
p1 p2 p3 p4 and 1 shared
4 4 4 4
so total alloted instance is 4+4+4+4+1=17
then remainning instance are 28-17=11
so, we have to check for n process and instance provide to them 5
if value of n=2
then minimum -> 4+4+1=9
if n=3
then 4+4+4+1=13
13 is minimum required but we have only 11
so ans is n=2