Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Chef is currently working for a secret research group called NEXTGEN. While the rest of the world is still in search of a way to utilize Helium-3 as a fuel, NEXTGEN scientists have been able to achieve 2 major milestones:
Moving forward, the project requires some government funding for completion, which comes under one condition: to prove its worth, the project should power Chefland by generating at least A units of power each year for the next B years.
Help Chef determine whether the group will get funded assuming that the moon has X grams of Helium-3 and 1 gram of Helium-3 can provide Y units of power.
For each test case print on a single line the answer — Yes
if NEXTGEN satisfies the government’s minimum requirements for funding and No
otherwise.
You may print each character of the answer string in either uppercase or lowercase (for example, the strings "yEs"
, "yes"
, "Yes"
and "YES"
will all be treated as identical).
Subtask #1 (100 points): Original constraints
Input: 4
1 2 3 4
4 3 2 1
2 18 9 4
1 100 2 49
Output: Yes
No
Yes
No
Test case 1: Chefland requires A=1 units of power for the next B=2 years. In total, the moon must be capable of providing A⋅B=2 units of power. There are in total X=3 grams of Helium-3 on the moon which is capable of providing X⋅Y=12 units of power. 12>2, so the project satisfies the minimum requirements for funding. Thus, the answer is Yes
.
Test case 2: The total amount of power needed by Chefland is A⋅B=12, whereas the total that can be provided by the Helium-3 present on the moon is X⋅Y=2, which is insufficient to receive funding, so the answer is No
.
Test case 3: The total amount of power needed by Chefland is A⋅B=2⋅18=36, and the total that can be provided by the Helium-3 present on the moon is X⋅Y=9⋅4=36, which is sufficient to receive funding, so the answer is Yes
.
Test case 4: The total amount of power needed by Chefland is A⋅B=1⋅100=100, and the total that can be provided by the Helium-3 present on the moon is X⋅Y=2⋅49=98, which is insufficient to receive funding, so the answer is No
.
#include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
int a,b,x,y;
cin>>a>>b>>x>>y;
if (a * b <= x * y ) {
cout<<"yes"<<endl;
}
else{
cout<<"no"<<endl;
}
}
// your code goes here
return 0;
}
# cook your dish here
for _ in range(int(input())):
a,b,x,y=map(int,input().split())
if x*y >= a*b:
print('YES')
else:
print('NO')
/* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc=new Scanner(System.in);
int T=sc.nextInt();
for(int i=0;i<T;i++){
int a=sc.nextInt();
int b=sc.nextInt();
int c=sc.nextInt();
int d=sc.nextInt();
if((c*d)>=(a*b)){
System.out.println("Yes");
}
else{
System.out.println("NO");
}
}
}
}
In our experience, we suggest you solve this Chef and NextGen CodeChef Solution and gain some new skills from Professionals completely free and we assure you will be worth it.
If you are stuck anywhere between any coding problem, just visit Queslers to get the Chef and NextGen CodeChef Solution
I hope this Chef and NextGen CodeChef Solution would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Coding Solutions.
This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.
Keep Learning!
More Coding Solutions >>