Input format :The first line of input will contain a single integer t, denoting the number of test cases.In each of the next t lines, the input consists of two space-separated integers X and Y representing the cost of Disposable Masks and Cloth Masks respectively.Output format :For each test case, the output displays "Cloth" if Ayan buys the cloth masks. Otherwise, the output displays "Disposable".
Question
Input format :The first line of input will contain a single integer t, denoting the number of test cases.In each of the next t lines, the input consists of two space-separated integers X and Y representing the cost of Disposable Masks and Cloth Masks respectively.Output format :For each test case, the output displays "Cloth" if Ayan buys the cloth masks. Otherwise, the output displays "Disposable".
Solution 1
I'm sorry, but you didn't provide a text for me to respond to. Could you please provide the text?
Solution 2
I'm sorry, but you didn't provide a text for me to respond to. Could you please provide the text?
Similar Questions
Input format :The first line contains an integer 't' representing the number of test cases.Each test case consists of a single line with two space-separated integers 'x' and 'y', representing the scores of Sasha and Brenda, respectively, for a particular round.Output format :For each test case, the output prints the result of that round.If x is greater than y, the output prints "Sasha".If x is equal to y, the output prints "Tie".Otherwise, the output prints "Brenda"
Ayan is shopping for masks. In the shop, he encounters 2 types of masks:Disposable Masks — cost X per mask and lasts for 5 daysCloth Masks — cost Y per mask and lasts for 10 daysWrite a program that takes the cost of Disposable Masks (X) and Cloth Masks (Y). The program should determine which type of mask Ayan should choose to minimize his expenses and print the decision. In case of a tie, he prefers Cloth Masks for environmental reasons.Write a program for the same using a for loop.For example: If X=10 & Y=100:Disposable masks last for 5 days, so the total cost is 10*5=50.Cloth masks last for 10 days, so the total cost is 100*10=1000.Disposable masks cost (50) < Cloth masks cost (10000). So Ayan prefers Disposable masks.Input format :The first line of input will contain a single integer t, denoting the number of test cases.In each of the next t lines, the input consists of two space-separated integers X and Y representing the cost of Disposable Masks and Cloth Masks respectively.Output format :For each test case, the output displays "Cloth" if Ayan buys the cloth masks. Otherwise, the output displays "Disposable".Refer to the sample output for formatting specifications.Code constraints :In the given scenario, the test cases will fall under the following constraints:2 ≤ n ≤ 101 ≤ Cost of each mask ≤ 100Sample test cases :Input 1 :410 100100 1014 71 11Output 1 :DisposableClothClothDisposableInput 2 :2100 988 99Output 2 :ClothDisposableInput 3 :101 23 45 67 89 1011 12100 1415 1699 1819 20Output 3 :DisposableDisposableDisposableDisposableDisposableDisposableClothDisposableClothDisposable
Input format :The input consists of three space-separated integers values A, B, and C, representing the first term 'A' of the arithmetic sequence, 'B' to check, and the common difference 'C' of the arithmetic sequence.Output format :The output displays 1 if 'B' is present in the arithmetic sequence, otherwise, it displays 0.
Chef and his girlfriend went on a date. Chef took 𝑋X dollars with him, and was quite sure that this would be enough to pay the bill. At the end, the waiter brought a bill of 𝑌Y dollars. Print "YES" if Chef has enough money to pay the bill, or "NO" if he has to borrow from his girlfriend and leave a bad impression on her.Input FormatThe first line of input will contain a single integer 𝑇T, denoting the number of test cases.Each test case consists of a single line of input, containing two space-separated integers 𝑋X and 𝑌Y.Output FormatFor each test case, output on a new line "YES" if Chef has enough money to pay the bill and "NO" otherwise.You may print each character of the string in either uppercase or lowercase (for example, the strings "yEs", "yes", "Yes" and "YES" will all be treated as identical).Constraints1≤𝑇≤1001≤T≤1001≤𝑋,𝑌≤1001≤X,Y≤100Sample 1:InputOutput41 11 22 150 100YESNOYESNOExplanation:Test case 11: Since the money Chef has is equal to the bill, he will be able to pay the bill.Test case 22: Since the money Chef has is less than the bill, he will have to borrow from his girlfriend and leave a bad impression on her.Test case 33: Since the money Chef has is greater than the bill, he will be able to pay the bill.Test case 44: Since the money Chef has is less than the bill, he will have to borrow from his girlfriend and leave a bad impression on her.
Note: Refer to the visible test cases for more clarity.Constraint:0≤𝑎≤1020≤𝑏≤102Input Format: The input consists of two numbers each in a new line (integer).Output Format: The output represents the result of the division of the two numbers or any error that occurred while dividing.Sample Test CasesTest Case 1:Expected Output:Enter·the·value·of·'a':·1Enter·the·value·of·'b':·0Arithmetic·Exception:·/·by·zeroTest Case 2:Expected Output:Enter·the·value·of·'a':·sInput·Mismatch·Exception:·Please·enter·valid·integer·values.Test Case 3:Expected Output:Enter·the·value·of·'a':·50Enter·the·value·of·'b':·4Result·of·a/b:·12Submit1234567891011121314151617181920212223242526272829303132import·java.util.InputMismatchException;¬import·java.util.Scanner;¬¬public·class·ExceptionHandlingExample·{¬————public·static·void·main(String[]·args)·{¬········Scanner·scanner=new·Scanner(System.in);¬········¬········try·{¬········————System.out.println("Enter·the·value·of·'a':·");¬········————int·a·=·scanner.nextInt();¬········————¬········————System.out.println("Enter·the·value·of·'b':·");¬········————int·b·=·scanner.nextInt();¬········————¬········————int·result=·divide(a,·b);¬········————System.out.println("Result·of·a/b:·"+result);¬········}·catch·(·ArithmeticException·e·)·{¬········¬········————System.out.println("ArithmaticExeception:/·by·zero");¬········}·catch·(InputMismatchException·e··)·{¬········————¬········————System.out.println("Input·Mismatch·Exception:·Please·enter·valid·integer·value.");¬········}¬¬····}¬¬····public·static·int·divide(·int·a,·int·b·)·{¬····————return·a/b;¬····————¬····}¬}¬¶Execution Results 0 out of 3 shown cases successful0 out of 4 hidden cases successfulShow only failed cases Test Case - 1 (Execution Time: 180 ms) Expected Output User OutputEnter·the·value·of·'a':·1Enter·the·value·of·'a':·1Enter·the·value·of·'b':·0 ↥0Arithmetic·Exception:·/·by·zero Enter·the·value·of·'b':·Extra outputArithmaticExeception:/ by zero : indicates the mismatch in the expected output. Test Case - 2 (Execution Time: 180 ms) Expected Output User OutputEnter·the·value·of·'a':·sEnter·the·value·of·'a':·sInput·Mismatch·Exception:·Please·enter·valid·integer·values. ↥ : indicates the mismatch in the expected output. Test Case - 3 (Execution Time: 197 ms) Expected Output User OutputEnter·the·value·of·'a':·50Enter·the·value·of·'a':·50Enter·the·value·of·'b':·4 ↥4Result·of·a/b:·12 Enter·the·value·of·'b':·Extra outputResult of a/b: 12
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.