Correct option is A
As we know the rule of divisibility by 3 is Sum of all numbers should be divisible by 3.
Here, 31P5 is divisible by 3
3 + 1 + P + 5 = 9 + P
So, the value of P should be (3, 6, 9)
= 9 + 3 = 12
Or, 9 + 6 = 15
Or, 9 + 9 = 18
So, the greatest value of P will be 9.