n%s will give the number of sectors left after making n records as groups of 's' sectors.
Now we need to add it to SL and check whether it will fill the current track and if yes then we will have to take that into consideration too.
Therefore, sector number of the nth record will be, let Sn= [ SL + (n%s) ]%s
Now for finding track number,we start with total number of tracks = n/s.
BUT we again need to check whether on adding it to TL, will it fill the current track.
Temp=[ SL + (n%s) ]÷s ,
just consider the non fractional part, it will tell us whether we need to jump track for leftover sectors. If 0._ that means we don't need extra track or else if 1._ then we need one extra track jump.
Therefore, track number of the nth record will be, let Tn = TL + (n/s) + Temp
And cylinder number of nth record Cn = CL + (Tn - TL)/t