Practice on Toph

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

Ice-cream of Montu Mia

By Raiyan13 · Limits 1s, 256 MB

Montu Mia is a student of “Omok School”. He likes to eat an icecream everyday. But he also likes to buy that ice-cream by his daily pocket money. His father always gives him maximum pocket money for the purpose of transportation cost only. Because his mother makes tiffin for him everyday.

So for Montu Mia, the only way to buy an ice-cream is saving money from his transportation cost as much as he can. The lowest price of an ice-cream is 10 taka.


The first line contains a single integer n (1 ≤ n ≤ 1000). This is the amount of pocket money given by Montu’s father.

The second line contains three space separated integers a, b, c (1 ≤ a, b, c ≤ n). These are the different costs (total costs) for different transports.


Print “Yes :-D” if Montu can buy an ice-cream otherwise print “No :-(” without quotes.


10  20  30
Yes :-D
15  17 20
No :-(



97% Solution Ratio

Minhaj_10Earliest, Jul '19

Minhaj_10Fastest, 0.0s

HillolTalukdarLightest, 0 B

anonyo.akandShortest, 71B


Login to submit

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