Given the dimension :
D500,51 meaning the main array size = 500 * 500
and there are 50 diagonals to be considered above and below the principal diagonal..As we know principal diagonal contains the elements which is equal to number of rows of array .So 500 entries in principal diagonal..
And then in each diagonal above and below , one less the previous diagonal..So we count for one side first..
So no of elements covered by 50 diagonals one side = 499 + 498 +........50 terms
= 50 / 2 [ 998 + 49 * (-1) ]
= 25 * [ 949 ]
= 23725
So no of elements both sides including principal diagonal = 23725 * 2 + 500
= 47950
Hence B) is the correct option.