Hard
Limit Concurrency
Run n jobs with gather, but allow at most 2 at a time using
asyncio.Semaphore(2). Each job increments a shared 'running' counter, records the maximum seen, sleeps a tiny bit, then decrements. Print the maximum number running at once and the number of jobs completed.Input
One integer n ≥ 1.
Output
Two numbers.
Sample 1
Input
5
Output
2 5
Sample 2
Input
1
Output
1 1
Output appears here