In how many ways can a person score a total of $130$ marks in an exam consisting of $3$ sections of $50$ marks each? In how many ways can a person score a total of $130$ marks in an exam consisting of $3$ sections of $50$ marks each?
What I did:-
$$a+b+c=130$$
So applying partition rule 
$n=130$ and $130$ marks has to be divided into three groups so $r=$
$132C2$
Now we will subtract the case when $a$, $b$ or $c$ is $51$, i.e. more than $50$.  Suppose $a$ is $51$.
\begin{align*}
51+b+c & = 130\\
b+c & = 79
\end{align*}
Now $n=79$ and $r=2$.
$80C1$
Similarly, for $b$ and $c$ also $= 80C1$
Final answer $= 132C2-3 \cdot (80C1)$
But actual  answer is $132C2-3 \cdot (81C2)+3 \cdot (30C2)$
Please someone explain me this. What is wrong with my answer? Why are we adding?

We wish to solve the equation
$$a + b + c = 130 \tag{1}$$
in the nonnegative integers subject to the restrictions that $a, b, c \leq 50$.
As you observed, equation 1 has 
$$\binom{130 + 2}{2} = \binom{132}{2}$$
solutions in the nonnegative integers.
From these, we must exclude those in which or more of the variables exceeds $50$.  Notice that at most two variables can exceed $50$ since $3 \cdot 51 = 153 > 130$.
Suppose $a > 50$.  Then $a' = a - 51$ is a nonnegative integer.  Substituting $a' + 51$ for $a$ in equation 1 yields
\begin{align*}
a' + 51 + b + c & = 130\\
a' + b + c & = 79 \tag{2}
\end{align*}
Equation 2 is an equation in the nonnegative integers with 
$$\binom{79 + 2}{2} = \binom{81}{2}$$
solutions.  By symmetry, there are the same number of solutions in which $b > 50$ or $c > 50$.  Hence, there are 
$$\binom{3}{1}\binom{81}{2}$$
solutions in which a variable exceeds $50$.
However, if we subtract $\binom{3}{1}\binom{81}{2}$ from the total, we will have subtracted too much since we have counted those cases in which two variables exceed $50$ twice, once for each way we could designate one of the variables as the one that exceeds $50$.  We only want to subtract those cases once, so we must add them back.  
Suppose $a > 50$ and $b > 50$.  Let $a' = a - 51$ and let $b' = b - 51$.  Then $a'$ and $b'$ are nonnegative integers.  Substituting $a' + 51$ for $a$ and $b' + 51$ for $b$ in equation 1 yields
\begin{align*}
a' + 51 + b' + 51 + c & = 130\\
a' + b' + c & = 28 \tag{3}
\end{align*}
Equation 3 is an equation in the nonnegative integers with 
$$\binom{28 + 2}{2} = \binom{30}{2}$$
solutions.  By symmetry, there are an equal number of solutions in which $a$ and $c$ both exceed $50$ and in which $b$ and $c$ both exceed $50$. Thus, there are 
$$\binom{3}{2}\binom{30}{2}$$
solutions in which two of the variables exceed $50$.
By the Inclusion-Exclusion Principle, the number of ways a person could obtain a score of $130$ marks on an examination consisting of three parts worth $50$ marks each is
$$\binom{132}{2} - \binom{3}{1}\binom{81}{2} + \binom{3}{2}\binom{30}{2}$$
