DOUGHNUT - Harry and big doughnuts

no tags 

Young Harry was asked to buy some foodstuffs for his neighbour – a strange old lady who lived with a bunch of fat cats. But the cats were strange too and they ate only doughnuts. So the lady wanted Harry to bring exactly one doughnut for each of her cats – and she had c of them. Harry had a rucksack with him but as he was a little boy he could carry only k kilograms. Harry knew that each doughnut weights w kilograms (big cats, big doughnuts). Help him decide whether he should go to supermarket and buy the doughnuts or just give up and dream he could do some magic...


There is a single positive integer t (t <= 100) on the first line of input which corresponds to the number of tests (Harry was asked to buy doughnuts few times). Then t lines follow, each containing three numbers: c, k and w (1 <= c, k, w <= 100).

t [number of tests]
c k w [number of cats, Harry's hoisting capacity and weight of doughnut]
c k w [next test case]


t lines containing word “yes” if Harry is capable of handling the task or “no” if doughnuts would cause his spine crack.


5 15 3
1 5 4
13 25 2


hide comments
kingfran1907: 2020-02-26 20:55:07

How to subimit pls help?? ?

narno: 2020-01-26 18:26:39

@synco please dont use turbo, use sublime configured for c++ or CLion or use codeblocks....

khushraj2005: 2017-12-21 12:47:19

how do you specify where the input is going?

adithyayelloju: 2017-08-22 18:31:25

is anybody completed this problem?
if yes then is it need to give '\n' output or without?

sy254191: 2017-06-16 16:57:04

same problem not in this also other i have submit 12 solution for this and one more problem but all are showing error but logic is correct please tell me.
i submit code "c" language

jack1_: 2017-04-27 20:25:10

Exactly. It says the code is wrong even though it compiles perfectly. I checked it in the IDE and worked perfectly, according to the conditions given. But, when compiled and run here it shows "compilation error".

akku_17: 2017-03-04 04:08:19

i am getting a runtime error , what do i do

fairoz: 2017-02-07 16:00:06

Guys i have submitted this problem but it says wrong. Now i want to understand that how this works please tell me and i'm new to this website.
Help me how to code the problems...

fabiolfilho: 2016-08-24 02:47:34


luc815689327: 2016-07-24 12:00:54

Last edit: 2016-07-24 12:19:21

Added by:wiele
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)

Problem's scores 1 vote

Concept difficulty
Concept difficulty 9%
Implementation difficulty
Implementation difficulty 8%
8 3