CodeChef Solution

Packaging Cupcakes Codechef Solution

Now that Chef has finished baking and frosting his cupcakes, it’s time to package them. Chef has N cupcakes, and needs to decide how many cupcakes to place in each package. Each package must contain the same number of cupcakes. Chef will choose an integer A between 1 and N, inclusive, and place exactly A cupcakes into each package. Chef makes as …

Packaging Cupcakes Codechef Solution Read More »

Second Largest Codechef Solution

Three numbers A, B and C are the inputs. Write a program to find second largest among them. Input  The first line contains an integer T, the total number of testcases. Then T lines follow, each line contains three integers A, B and C. Output  For each test case, display the second largest among A, B and C, in a new line. Constraints 1 <= T <= 1000 1 …

Second Largest Codechef Solution Read More »

Finding Square Roots Codechef Solution

In olden days finding square roots seemed to be difficult but nowadays it can be easily done using in-built functions available across many languages . Assume that you happen to hear the above words and you want to give a try in finding the square root of any given integer using in-built functions. So here’s …

Finding Square Roots Codechef Solution Read More »