Code Practice


  2. Read the Question very carefully in the 1st chance.
  3. Look at the Input and Output Format of the program.
  4. Look at the constraints of the program.
  5. Choose your programming language.
  6. Set the conditions.
  7. Start Coding.
  8. Check Public test cases are passed or not?
  9. Then check Private test cases are passed or not?


Problem 1

Niti and Samy Soft Drink Party

Niti and Samy are the two friends. They are invited in a party. Niti is offered ‘a’ number of soft drinks of X brand and Samy is offered ‘b’ number of soft drinks of Y brand.

But here is a problem that Niti does not prefer X brand and Samy does not prefer Y brand.

Niti prefers Y brand and Sami Prefers X brand. They decide to switch their drinks to each other and Niti will take one more of her preferred brand and Samy will also take two more of her preferred brand. So at the end of the party how many number of drinks will be to Niti and Samy?


5 8


9 7

Input restriction



Problem 2

Washing Machine