__Problem A__

Iterate over all possible pairs of soldiers and count those having difference of their heights less than or equal to

*d.*

__Problem B__

Replace all occurrences of '--' with '2', '-.' with '1' and '.' with '0'.

Initially, there was some problem with the test cases but was rectified soon.

__Problem C__

I won't be discussing my approach to this problem as my solution was hacked :( and I haven't tried another approach yet.

Earlier I thought that my code failed because I was using

*int*for storing answer,but later found that its giving WA after changing it to*long*.__Problem D__

Simple approach was to start finding stars in order of their indexes.

For this, first try for stars with smaller radius, then for top and finally for left.

Following code may explain it further.

int radius, x, y;

for(radius=1; k>0 && radius<=150;++radius)

for(x=radius; k>0 && x < N-r;++x)

for(y=radius; k>0 && y < N-r;++y)

if(StarAt(x,y,radius))

k--;

if(k==0)

//display start at x,y,radius

else

//display -1

__Problem E__

Haven't yet solved this problem too. Will be updating soon.

This was my second contest at Codeforces. I was able to solve more problems this time and enter div 1, so enjoyed it :)