Submit | All submissions | Best solutions | Back to list |
DOUGHNUT - Harry and big doughnuts |
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...
Input
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]
...
Output
t lines containing word “yes” if Harry is capable of handling the task or “no” if doughnuts would cause his spine crack.
Example
Input: 3 5 15 3 1 5 4 13 25 2 Output: yes yes no
Added by: | wiele |
Date: | 2009-03-26 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |
hide comments
|
|||||||
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... |
|||||||
2016-08-24 02:47:34
easy |
|||||||
2016-07-24 12:00:54
Last edit: 2016-07-24 12:19:21 |
|||||||
2016-03-24 22:49:39
Nothing special in this question |
|||||||
2016-01-03 08:41:24
guys i'm new to this forum hence my questions might feel idiotic!!! i use turbo c++ on dosbox(MBA on el capitan) and i directly copied the source code and when i used C++(g++,4.3.2) I'm getting compilation error .... pls help ASAP!! |
|||||||
2015-10-08 13:59:20 kamran siddique
100th (As per HackerEarth record!!!!!) ,,,:) |
|||||||
2015-09-26 02:12:05
Y my ans is wrong .. As i have checked the code and it is fine.. |
|||||||
2015-09-02 13:45:47
giving wrong answer even though its running correctly |
|||||||
2015-09-01 07:39:32
What is wrong in the code I have written (in python) c,k,w=input('Enter the number of cats, weight Harry can carry and weight of each doughnuts separated by commas:') if k >= (c*w): print 'yes' else: print 'no' |
|||||||
2015-08-09 09:34:18
isn't it just if c*w <= k and if not? |