In SNACKUP why cant i set k=2 for all the values of n as it is mentioned that we can select k that is no. of judges invited arbitrarily. Selecting k=2 will gave same answer for all values of n. Why is this not possible. asked 19 Jun '17, 01:28

The problem statement was purposely made large to make participants think of it as a hard problem. (Due to which i SKIPPED doing it till end...GOSH!!) The problem said that, you can organize ANY number of rounds, inviting ANY number of judges (upto N, of course). Every round, Ada will make 2 x k dishes dishes. Every dish must be eaten, and a judge cannot eat same dish twice, AND a judge cannot eat more than 2 dishes. At the end of all the rounds, the statistics should be such that EVERY JUDGE TASTED EVERY DISH EXACTLY TWICE. What i came up with, was to hold N rounds, invite ALL N judges, and make then eat dishes as
This is one of the easiest solution to this problem. I hope i made the pattern clear. In case of any further doubts, let me know ^^ answered 19 Jun '17, 07:08

As @hikarico has rightly said, if you set k=2 you are focusing only on the even number of judges. N matters in your case because if you are going via that route of selecting specific K's then there will be two cases  check for n to be even or odd. Because, as it is said in the question, in each round, the girl prepares two copies of the same dish, so if n is even, you could easily distribute the dish pairs to each of the judges. However, if the number of judges(n) is odd, then you will have to specially take care of dividing dish pairs to different judges. Although it is not impossible via this route, you have to handle for both even and odd cases. answered 19 Jun '17, 01:48

Selecting k=2 every time will only work for even number of judges. You'll have to do something more for odd n. answered 19 Jun '17, 01:30

2 2 1 1 2 2 1 2 2 1 1 2 2 1 2 this will be the answer every time i put k=2 where is the problem please point out specifically. The rule of the contest is each judge (ie 2 here) must have tasted each dish (ie 2 dishes) exaclty twice which is happening here.How does n matters? Thanks for replying answered 19 Jun '17, 01:36

You wrote the answer for n=2, that is correct... Put n=3 and take a review to the answer, does it hold the condition yet? answered 19 Jun '17, 01:40

i think i am confused with the conditions could any1 please clarify it for me what exactly need to be done. Thanks in advance :) answered 19 Jun '17, 01:44

I spent a significant amount of time trying to understand this question. The key phrases are wrapped in asterisks:
Basically, you're given a fix amount of judges from the input. Each of the judge must have tasted every recipe exactly twice, and Ada will prepare 2 dishes for each recipe she prepared. Every round, all the judges will taste exactly 2 dishes. Therefore, the amount of round is determined by the number of judges given by the input. If there are 4 judges, 4 rounds is needed to allow a total of 8 sampling of the dishes (2 dishes each recipe, 4 rounds X 2 dishes = 8 dishes). You can look at my code here for better understanding: my python3 answer answered 19 Jun '17, 09:26
