HackerEarth Crazy kangaroo challenge
Data declarations

Your data types are not large enough.  By the C standard, an int is only guaranteed to hold up to 32767, which is smaller than 100000.  Similarly, an int could be insufficient to hold the values of A, B, and M.  You'll need a long long or int64_t.

A big block of declarations like this is not ideal:


unsigned int n, i, j, k, h,count=0,l=0;




You should declare variables as close to the point of use and in as tight a scope as possible.
Single-character names are cryptic.


Algorithm

You don't have to simulate a kangaroo, counting hops, to answer these questions.  The answer will be roughly

$$\frac{B - A}{M}$$

… except that you have to take care of fencepost (off-by-one) errors at the edges.  I'll leave it to you to figure out the details.