Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Treat Time

Limits 1s, 512 MB

Labiba ma'am wants to give a treat to her favorite student Nafia. But as she now lives abroad, Labiba ma'am gave this responsibility to Shuvo.

Shuvo wants to buy ice-cream for Nafia. But Nafia loves chocolate. She prefers chocolate over ice-creams. As Shuvo has a limited budget he either can buy chocolate or ice-cream for Nafia. So he decided,

  1. If the price of both items are within his budget he will go for Nafia’s favorite one.

  2. If the price of both items are beyond his budget, he will buy chocolate anyhow.

  3. Else he will buy the item which is in his budget.

Now write a program to let us know what Shuvo will buy?


There will be three numbers A, B, and C (0 ≤ A, B, C ≤ 1000).

A denotes the budget, and B and C are the price of chocolate and ice-cream respectively.


Output the item name which Shuvo will buy.


100 50 50
100 110 10



91% Solution Ratio

RabelAhmedEarliest, Jul '17

raselrokyFastest, 0.0s

user.q8rbrzjzLightest, 0 B

anonyo.akandShortest, 79B


Login to submit

Toph uses cookies. By continuing you agree to our Cookie Policy.