Ad Infinitum Maths HackerRank problem
Difference between en3 and en4, changed 1,008 character(s)
Greetings Codeforces : -↵
I was stuck on this [Problem](https://www.hackerrank.com/contests/infinitum12/challenges/a-birthday-party) and it's editorial is also not clear enough. 
So if someone can explain how to solve this problem,it will be highly appreciated. ↵
You can find its [Editorial](https://www.hackerrank.com/contests/infinitum12/challenges/a-birthday-party/editorial) here.I wanted to ask one question that if we have modular equations like in this problem and if the mod is prime then is it true that they will be equal.I mean in this task C(i) = sum of its C(j)'s % mod and since mod is prime number does that mean they have to be equal(C(i) = sum of its C(j)'s).Of course for composite numbers it will definiately not hold because one simple case to fail it will be to consider a factor of mod and if n = mod/factor + 2 then it easily fails as 1 will be friend with all others and all others having 1 as his friend & and all of them having equal candies.Of course there will be only few n to fail this depending on the factors mod has but afterall there are cases.So if there is such a property for prime numbers I would like to know it (not taking into account case of 1).And yeah also please give some hints on how to solve this problem using Gaussian Elimination or any other method you like suitable.Thanks in advance.


 

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English marcose18 2015-07-06 13:05:18 1008
en3 English marcose18 2015-07-06 12:47:40 18
en2 English marcose18 2015-07-06 12:46:59 33
en1 English marcose18 2015-07-06 12:45:21 288 Initial revision (published)