Since, it is mention in question that array is in increasing order.
a[ j ] - a[ i ] > S , if is true. Does it make any sense to increment j because, it will increase the gap between them by every increment.
Option A : Wrong
a[ j ] - a[ i ] < S , if is true. Now if we increment j it will lead to increase in value of (a[ j ] - a[ i ] say equal to x) which is required because x<S after every in it will come close to S and might equal to S, if there are exactly two distinct integer present who difference is S.
Option B : Correct
a[ i ] - a[ j ] < S ,if is true. LHS has a negative value and RHS has a positive value.
Option C : Wrong
a[ i ] - a[ j ] > S ,if is true , not all possible pair can formed. Ex:-
Iteration index index expression output
1 0 1 a[0] - a[1] >S i++
2 1 1 a[1] - a[1] >S i++
3 2 1 a[2] - a[1] >S doesn't matter
since pair (a[2] - a[0] ) is not considered what if this gives the unique S.
Option D : Wrong