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...

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


hide comments
gjohnrao: 2015-06-29 20:33:46

whats wrong in my code? I get runtime error NZEC

import java.util.*;
import java.lang.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

class Main
{
public static void main (String[] args) throws java.lang.Exception
{

java.io.BufferedReader inp = new java.io.BufferedReader (new java.io.InputStreamReader (System.in));
int t= Integer.parseInt(inp.readLine());
System.out.println(t);
int c= Integer.parseInt(inp.readLine());
System.out.print(c + " ");
int k= Integer.parseInt(inp.readLine());
System.out.print(k + " ");
int w= Integer.parseInt(inp.readLine());
System.out.print(w);

if(c * w < k)
{
System.out.println("Yes");
}
else
{
System.out.println("No");
}

}
}

Sujit Kumar Kisku: 2015-06-22 00:19:03

Why the result is 'wrong answer'? I have checked and run my program and its giving same answer as it is in the problem.

Sujit Kumar Kisku: 2015-06-22 00:17:56

Why the result is 'wrong answer'? I have checked and run my program and its giving same answer as it is in the problem.

Sujit Kumar Kisku: 2015-06-22 00:16:55

Why the result is 'wrong answer'? I have checked and run my program and its giving same answer as it is in the problem.

ahmaddwij: 2015-04-22 16:26:19

When I run my java code using NetBeans to solve this problem, I've got my code works well, giving same output as this task output. But, when i submit my code in this page, it said Wrong Answer T_T. What's wrong man ?

ahmaddwij: 2015-04-22 15:56:42

I can't understand this problem

aditya singh: 2014-12-06 18:51:15

how to solve this???

headfirstcoder: 2014-11-02 14:17:17

My subbmission is: 12794762 (CodeMesh)

Ali Yusuf: 2014-10-29 09:53:42

It's obviously a good problem for beginners to inspire..

Psycho_bhatt: 2014-10-29 09:53:42

CakeWalk :)


Added by:wiele
Date:2009-03-26
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All

Problem's scores 1 vote

Concept difficulty
Concept difficulty 8%
Implementation difficulty
Implementation difficulty 7%
8 4