All submissions for this problem are available.
Read problems statements in mandarin chinese, russian and vietnamese as well.
This year CodeChef is organizing the SnackUp cooking contest. The favorite to win is of course our beautiful Chef Ada.
There are n judges in the contest, and for simplicity let's enumerate judges from 1 to n.
Ada has an uncountable repertoire of delicious recipes, but for the contest she choose only n of them. Let's also enumerate the recipes from 1 to n.
Ada is going to show off her cooking skills in many rounds, and we are going to help her organizing them! One round is structured as follows:
- We will choose k distinct recipes and Ada will prepare two identical dishes for each of them.
- We will choose k distinct judges for the round.
- We will send k invitation letters (one for each of the chosen judges). Each letter must contain the number of the judge, and two distinct integers denoting the ids of the recipes that he is going to taste.
- Two different judges can taste the same recipe, but it must be from different dishes.
- Ada does not like to waste food, so the letters must be designed in such a way that every prepared dish is tasted.
The first line of input contains one number T, the number of test cases. Each test case consist of one line containing an integer n, the number of judges.
For each testcase, in the first line, print r the number of rounds, then describe each round as follows.
In the first line of each round, print k, the number of invited judges.
In the next k lines, print the invitation letters as three space separated integers: j, x, y denoting the id of the judge, and the ids of the recipe that he is going to taste. Note that x should not be equal to y.
Input: 1 2 Output: 2 2 1 1 2 2 1 2 2 1 1 2 2 1 2
|Tags||ad-hoc, alei, constructive, cook83, easy|
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.