# 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 …

## 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 …

## The Lead Game Codechef Solution

The game of billiards involves two players knocking 3 balls around on a green baize table. Well, there is more to it, but for our purposes this is sufficient. The game consists of several rounds and in each round both players obtain a score, based on how well they played. Once all the rounds have …

## 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 …

## Reverse The Number Codechef Solution

Given an Integer N, write a program to reverse it. Input The first line contains an integer T, total number of testcases. Then follow T lines, each line contains an integer N. Output For each test case, display the reverse of the given number N, in a new line. Constraints 1 <= T <= 1000 1 <= N <= 1000000 Example …

## Lucky Four Codechef Solution

Kostya likes the number 4 much. Of course! This number has such a lot of properties, like: Four is the smallest composite number; It is also the smallest Smith number; The smallest non-cyclic group has four elements; Four is the maximal degree of the equation that can be solved in radicals; There is four-color theorem …