The eq. Is:
x2 - (a+2)x + (2a-120)=0
Let roots be A,B.
A=1/2[(a+2)+{(a+2)2-4*(2a-120)}0.5]
B=1/2[(a+2)-{(a+2)2-4*(2a-120)}0.5]
Let D=(a+2)2-4*(2a-120)
Or D=(a2+4+4*a-8*a+480)
=(a2-4*a+484)
Since A,B is an integer.
Hence D must be perfect square.
Let D=K2 where K is a positive int.
Hence A=[a+2+K]/2 eq (1)
And B=[a+2-K]/2 eq (2)
Now D=K2
Or a2-4*a+484=K2
(a-2)2+480=K2 eq (3)
or (K-a+2)(K+a-2)=480
Since K and a both are int.
The LHS will be multiple of two int.
480 can be written in multiples of two integers?.
(1,480) (2,240) (5,96) (3,160) (4,120) (10,48) (6,80) (15,32) (8,60) (20,24) (12,40) (30,16) ........
by comparing the two sides you can find the values of K and a.
for ex. (K-a+2)(K+a-2)=20*24
on comparing : K-a+2=20
K+a-2=24
On adding 2*K=44
Or K=22
From eq. (3) you will find that a=0 and 4
So for every value of K there will be two values of a.
Out of above 12 multiples, 4 does not give the intger valve of K.
So for rest 8 you can get 8 possible value of K and corresponding 16 values of a,
And so you can get the ans.