Chef and Bird farm solution codechef

Chef and Bird farm solution codechef   In Chefland, each chicken has XX legs and each duck has YY legs. Chef’s farm can have exactly one type of bird. Given that the birds on the farm have a total of ZZ legs: Print CHICKEN, if the farm can have only chickens but not ducks. Print DUCK, if the farm can have only ducks but not … Read more

[Ans] Reduce to 1 solution codechef

[Ans] Reduce to 1 solution codechef   Arun has an integer NN. His friend Sucksum likes the number 11, so Arun wants to reduce NN to 11. [Ans] Reduce to 1 solution codechef To do so, he can perform the following move several times (possibly, zero): Pick two integers XX and YY such that X+YX+Y is even and XYXY is a divisor of NN. Then, replace NN by NXYNXY Note that at … Read more

Lost Arithmetic Progression solution codeforces

Long ago, you thought of two finite arithmetic progressions 𝐴A and 𝐵B. Then you found out another sequence 𝐶C containing all elements common to both 𝐴A and 𝐵B. It is not hard to see that 𝐶C is also a finite arithmetic progression. After many years, you forgot what 𝐴A was but remember 𝐵B and 𝐶C. You are, for some reason, determined to find this lost arithmetic progression. Before you begin this … Read more