Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
The summer is at its peak in Chefland. Chef is planning to purchase a water cooler to keep his room cool. He has two options available:
Given that the summer season will last for MM months in Chefland, help Chef in finding whether he should rent the cooler or not.
Chef rents the cooler only if the cost of renting the cooler is strictly less than the cost of purchasing it. Otherwise, he purchases the cooler.
Print \texttt{YES}YES if Chef should rent the cooler, otherwise print \texttt{NO}NO.
For each test case, output \texttt{YES}YES if Chef should rent the cooler, otherwise output \texttt{NO}NO.
You may print each character of the string in uppercase or lowercase (for example, the strings \texttt{YeS}YeS, \texttt{yEs}yEs, \texttt{yes}yes and \texttt{YES}YES will all be treated as identical).
Input: 3
5 10 1
5 10 2
5 10 3
Output: YES
NO
NO
Test case 11: Cost of renting the cooler = 5=5 coins. Cost of purchasing the cooler = 10=10 coins. So, Chef should rent the cooler as the cost of renting the cooler for 11 month is strictly less than purchasing it.
Test case 22: Cost of renting the cooler = 10=10 coins. Cost of purchasing the cooler = 10=10 coins. So, Chef should not rent the cooler as the cost of renting the cooler for 22 months is not strictly less than purchasing it.
Test case 33: Cost of renting the cooler = 15=15 coins. Cost of purchasing the cooler = 10=10 coins. So, Chef should not rent the cooler as the cost of renting the cooler for 33 months is not strictly less than purchasing it.
/* 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
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(br.readLine());
while (t-- > 0) {
String[] line = br.readLine().split(" ");
int x = Integer.parseInt(line[0]);
int y = Integer.parseInt(line[1]);
int m = Integer.parseInt(line[2]);
System.out.println(x * m < y ? "YES" : "NO");
}
}
}
# cook your dish here
t=int(input())
for i in range(t):
x,y,m=map(int,input().split())
a=x*m
if a<y:
print("yes")
else:
print("no")
#include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
int x, y, m;
cin>>x>>y>>m;
if(x*m< y){
cout<<"YES";
}
else{
cout<<"NO";
}
cout<<endl;
}
return 0;
}
In our experience, we suggest you solve this The Cooler Dilemma 1 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 The Cooler Dilemma 1 CodeChef Solution
I hope this The Cooler Dilemma 1 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 >>