## Game of Piles Version 1 Solution Codechef

Game of Piles Version 1 Solution Codechef There are N piles where the ith pile consists of Ai stones. Chef and Chefina are playing a game taking alternate turns with Chef starting first. In his/her turn, a player can choose any non-empty pile and remove exactly 1 stone from it. The game ends when exactly 1 pile becomes empty. The player who made the last move wins. Determine … Read more

## Journey of the Knight Solution Codechef

Journey of the Knight Solution Codechef Chef has an 8×8 chessboard. He placed a knight on the square (X1,Y1). Note that, the square at the intersection of the ith row and jth column is denoted by (i,j). Chef wants to determine whether the knight can end up at the square (X2,Y2) in exactly 100 moves or not. For reference, a knight can move to a square which is: A … Read more

## Slow Solution Solution Codechef

Slow Solution Solution Codechef Chef is trying to solve a problem having T test cases, where, for each test case he is given a single integer N. Chef has an algorithm which takes exactly N2 iterations for a test case with value N. The constraints of the problem are as follows: Given the values maxT,maxN, and sumN, determine the maximum number of iterations Chef’s algorithm can … Read more

## Chef and Candies Solution Codechef

Chef and Candies Solution Codechef There are N children and Chef wants to give them 1 candy each. Chef already has X candies with him. To buy the rest, he visits a candy shop. In the shop, packets containing exactly 4 candies are available. Determine the minimum number of candy packets Chef must buy so that he is able to give 1 candy to each of the N children. Input … Read more

## Pass the Exam Solution Codechef

Pass the Exam Solution Codechef Chef appeared for an exam consisting of 3 sections. Each section is worth 100 marks. Chef scored A marks in Section 1, B marks in section 2, and C marks in section 3. Chef passes the exam if both of the following conditions satisfy: Determine whether Chef passes the exam or not. Input Format Output Format Constraints Sample Input 1 Sample Output 1 Explanation SOLUTION … Read more