Consider a cricket match-up with a progression of $N$ overs (numbered $1$ through $N$) played by $K$ players (numbered $1$ through $K$). Every player might be the bowler for at most $L$ overs altogether, yet a similar player may not be the bowler for any two successive overs. Appoint precisely one bowler to each over so that these principles are fulfilled or establish that no such task exists. 
The primary line of the information contains a solitary whole number $T$ signifying the quantity of experiments. The depiction of $T$ experiments follows. 
The sole line of each experiment contains three space-isolated whole numbers $N$, $K$ and $L$. 
For each experiment: 
In the event that there is no legitimate task of bowlers to overs, print a solitary line containing the number $-1$. 
Something else, print a solitary line containing $N$ space-isolated whole numbers. For each substantial $i$, the $i$-th of these whole numbers ought to be the quantity of the player alloted as the bowler for the $i$-th over. 
$1 le T le 30$ 
$1 le N, K, L le 10,000$ 
Model Input 
4 3 2 
5 4 1 
Model Output 
1 2 3 2 
– 1 
Model case 1: coming up next is a substantial task: 
Bowler 1 dishes the $1$-st over. 
Bowler 2 dishes the $2$-nd and $4$-th overs. 
Bowler 3 dishes the $3$-rd over. 
It is legitimate since no bowler bowls more than $2$ overs and every two continuous overs have various bowlers. 
Model case 2: There is no legitimate task wherein each of $4$ players astounds all things considered $1$ out of $5$.


March Long Challenge 2021 Solutions

April Long Challenge 2021 Solutions

Codechef Long Challenge Solutions

February Long Challenge 2021

1. Frog Sort Solution Codechef

2. Chef and Meetings Solution Codechef

3. Maximise Function Solution Codechef

4. Highest Divisor Solution Codechef

5. Cut the Cake Challenge Solution Codechef

6. Dream and the Multiverse Solution Codechef

7. Cell Shell Solution Codechef

8. Multiple Games Solution Codechef

9. Another Tree with Number Theory Solution Codechef

10. XOR Sums Solution Codechef

11. Prime Game Solution CodeChef

12. Team Name Solution Codechef

January Long Challenge 2021

November Challenge 2020 SOLUTION CodeChef

October Lunchtime 2020 CodeChef SOLUTIONS


Related :

Related :

Leave a Comment

2 × four =