Published August 24, 2022 by

Odd Pairs Codechef code Java (ODDPAIRS)

ProblemGiven an integer NN, determine the number of pairs (A, B)(A,B) such that:1<=A,B<=NA + B is odd.Input FormatThe first line of input will contain a single integer TT, denoting the number of test cases.Each test case consists of a single integer NN.Output FormatFor each test case, output the number of required pairs.Constraints1<=T<=1001<=N<=10^9Input512 3100199Output024500019800 ...
Read More
Published August 24, 2022 by

Weights Codechef code Java ,(WGHTS)

ProblemChef is playing with weights. He has an object weighing WW units. He also has three weights each of X, Y,X,Y, and ZZ units respectively. Help him determine whether he can measure the exact weight of the object with one or more of these weights.If it is possible to measure the weight of object with one or more of these weights, print YES, otherwise print NO.Input FormatThe first line of input...
Read More
Published August 24, 2022 by

Greater Average Codechef Java Code, (AVGPROBLEM)

ProblemYou are given 33 numbers A, B,A,B, and CC.Determine whether the average of AA and BB is strictly greater than CC or not?NOTE: Average of AA and BB is defined as \frac{(A+B)}{2}2(A+B)​. For example, average of 55 and 99 is 77, average of 55 and 88 is 6.56.5.Input...
Read More
Published August 24, 2022 by

Car Trip Code chef, Solution Java (CARTRIP)

ProblemThe chef rented a car for a day.Usually, the cost of the car is Rs 1010 per km. However, since Chef has booked the car for the whole day, he needs to pay for at least 300300 kms even if the car runs less than 300300 kms.If the car ran XX kms, determine the cost Chef needs to pay.Input FormatThe first line of input will contain a single integer TT, denoting the number of test cases.Each test...
Read More
Published August 13, 2022 by

Make A and B equal CodeChef - Java Code EQUALISE

 Make A and B equal CodeChef Java Code EQUALISEProblem Code: EQUALISEProblem:Chef has two numbers AA and BB.In one operation, Chef can choose either AA or BB and multiply it by 22.Determine whether he can make both AA and BB equal after any number (possibly, zero) of moves.Input Format:The first line of input will contain a single integer TT, denoting the number of test cases.Each test case consists...
Read More