As given in question total 'n' processes are there and all those 'n' processes sharing the CPU in Round Robin fashion.
Each process switch takes 's' seconds.
'n' processes -> p1, p2, p3, ..., pn
Quantum size is 'q' -> Which we need to find in a way that overhead resulting from process switching is minimized.
Overhead is Process Switching or Context Switching. Its called overhead as during switching CPU is not executing any process and is not doing any work which can help us improve efficiency.
Each process runs for 'q' time in CPU.
'n' process -> p1 | p2 | p3 | ... | pn | p1
As given that each process is guaranteed to get its turn at the CPU at least every 't' second.
After 't' seconds p1 will be given to CPU for execution. So, sum up all the time and it must be less than or equal to 't' because as we need to give process to CPU again after 't' seconds. if it's more than 't' then you cant guarantee to give process to CPU after 't'.
p1 to p1 it's having 'n' context or process switches.
from p2 to pn total 'n-1' processes and all executing for 'q' Quantum time. We need to count after pi executes so, 'n-1' processes.
(n-1)*q + n*s <= t