Knowee
Questions
Features
Study Tools

Alice and Bob have four distinct integers a๐‘Ž, b๐‘, c๐‘, d๐‘‘ not more than 1212. Alice ties a red string connecting a๐‘Ž and b๐‘, and Bob ties a blue string connecting c๐‘ and d๐‘‘. Do the strings intersect? (The strings are straight line segments.)InputThe first line contains a single integer t๐‘ก (1โ‰คtโ‰ค59401โ‰ค๐‘กโ‰ค5940)ย โ€” the number of test cases.The only line of each test case contains four distinct integers a๐‘Ž, b๐‘, c๐‘, d๐‘‘ (1โ‰คa,b,c,dโ‰ค121โ‰ค๐‘Ž,๐‘,๐‘,๐‘‘โ‰ค12).OutputFor each test case, output "YES" (without quotes) if the strings intersect, and "NO" (without quotes) otherwise.You can output "YES" and "NO" in any case (for example, strings "yEs", "yes", and "Yes" will be recognized as a positive response).ExampleinputCopy152 9 10 63 8 9 11 2 3 45 3 4 121 8 2 103 12 11 89 10 12 112 1 10 23 12 6 91 9 8 46 7 9 127 12 9 610 12 11 13 9 6 121 4 3 5outputCopyYESNONOYESYESNONONONONONOYESYESYESYESNoteThe first test case is pictured in the statement.In the second test case, the strings do not intersect, as shown below.

Question

Alice and Bob have four distinct integers a๐‘Ž, b๐‘, c๐‘, d๐‘‘ not more than 1212. Alice ties a red string connecting a๐‘Ž and b๐‘, and Bob ties a blue string connecting c๐‘ and d๐‘‘. Do the strings intersect? (The strings are straight line segments.)InputThe first line contains a single integer t๐‘ก (1โ‰คtโ‰ค59401โ‰ค๐‘กโ‰ค5940)ย โ€” the number of test cases.The only line of each test case contains four distinct integers a๐‘Ž, b๐‘, c๐‘, d๐‘‘ (1โ‰คa,b,c,dโ‰ค121โ‰ค๐‘Ž,๐‘,๐‘,๐‘‘โ‰ค12).OutputFor each test case, output "YES" (without quotes) if the strings intersect, and "NO" (without quotes) otherwise.You can output "YES" and "NO" in any case (for example, strings "yEs", "yes", and "Yes" will be recognized as a positive response).ExampleinputCopy152 9 10 63 8 9 11 2 3 45 3 4 121 8 2 103 12 11 89 10 12 112 1 10 23 12 6 91 9 8 46 7 9 127 12 9 610 12 11 13 9 6 121 4 3 5outputCopyYESNONOYESYESNONONONONONOYESYESYESYESNoteThe first test case is pictured in the statement.In the second test case, the strings do not intersect, as shown below.

...expand
๐Ÿง Not the exact question you are looking for?Go ask a question

Solution

I'm sorry, but you didn't provide a specific text for me to respond to. Could you please provide the text?

Similar Questions

Alice has scored ๐‘‹X marks in her test and Bob has scored ๐‘ŒY marks in the same test. Alice is happy if she scored at least twice the marks of Bobโ€™s score. Determine whether she is happy or not.Input FormatThe first and only line of input contains two space-separated integers ๐‘‹,๐‘ŒX,Y โ€” the marks of Alice and Bob respectively.Output FormatFor each testcase, print Yes if Alice is happy and No if she is not, according to the problem statement.The judge is case insensitive so you may output the answer in any case. In particular YES, yes, yEsare all considered equivalent toYes`.Constraints1โ‰ค๐‘‹,๐‘Œโ‰ค1001โ‰คX,Yโ‰ค100Sample 1:InputOutput2 1YesExplanation:Alice has scored ๐‘‹=2X=2 marks whereas Bob has scored ๐‘Œ=1Y=1 mark. As Alice has scored twice as much as Bob (i.e. ๐‘‹โ‰ฅ2๐‘ŒXโ‰ฅ2Y), the answer is Yes.

Bob received an assignment from his school: he has two numbers ๐ดA and ๐ตB, and he has to find the sum of these two numbers.Alice, being a good friend of Bob, told him that the answer to this question is ๐ถC.Bob doesn't completely trust Alice and asked you to tell him if the answer given by Alice is correct or not.If the answer is correct print "YES", otherwise print "NO" (without quotes).Input FormatThe first line of input will contain a single integer ๐‘‡T, denoting the number of test cases.The first and only line of each test case consists of three space-separated integers ๐ด,๐ต,A,B, and ๐ถC.Output FormatFor each test case, output on a new line the answer: YES if Alice gave the right answer, and NO otherwise.Each character of the output may be printed in either uppercase or lowercase, i.e, the outputs Yes, YES, yEs and yes will be treated as equivalent.Constraints1โ‰ค๐‘‡โ‰ค1001โ‰คTโ‰ค1000โ‰ค๐ด,๐ต,๐ถโ‰ค1000โ‰คA,B,Cโ‰ค100Sample 1:InputOutput31 2 34 5 92 3 6YESYESNOExplanation:Test case 11: 1+2=31+2=3, so Alice's answer is correct.Test case 22: 4+5=94+5=9, so Alice's answer is correct.Test case 33: 2+3=52+3=5 which doesn't equal 66, so Alice's answer is incorrect.

There are ๐‘N students including Chef in a school. The school bus has ๐‘€M seats, and every student in the school travels on the bus.It is guaranteed that ๐‘โ‰ค๐‘€Nโ‰คM, so that everyone will have a seat.Chef is happy when the school bus is not full.Given ๐‘N and ๐‘€M, your task is to find out whether Chef will be happy.Input FormatThe only line of input will contain two space-separated integers ๐‘N and ๐‘€M, denoting the number of students in the school and the number of seats in the school bus respectively.Output FormatFor each test case, output on a new line the answer: YES, if Chef will be happy, and NO otherwise.You may print each character of the string in uppercase or lowercase (for example, the strings YeS, yEs, yes, and YES will all be treated as identical).Constraints1โ‰ค๐‘โ‰ค๐‘€โ‰ค101โ‰คNโ‰คMโ‰ค10Sample 1:InputOutput2 3YESExplanation:There are 22 students and 33 seats on the bus.So, there will be one empty seat on the bus and Chef will be happy.Sample 2:InputOutput6 6NOExplanation:There are 66 students and 66 seats on the bus.The bus will be full and Chef will not be happy.

Alice and Bob were having an argument about which of them is taller than the other. Charlie got irritated by the argument, and decided to settle the matter once and for all.Charlie measured the heights of Alice and Bob, and got to know that Alice's height is ๐‘‹X centimeters and Bob's height is ๐‘ŒY centimeters. Help Charlie decide who is taller.It is guaranteed that ๐‘‹โ‰ ๐‘ŒX๎€ =Y.Input FormatThe first line of input will contain an integer ๐‘‡T โ€” the number of test cases. The description of ๐‘‡T test cases follows.The first and only line of each test case contains two integers ๐‘‹X and ๐‘ŒY, as described in the problem statement.Output FormatFor each test case, output on a new line AA if Alice is taller than Bob, else output BB. The output is case insensitive, i.e, both AA and aa will be accepted as correct answers when Alice is taller.Constraints1โ‰ค๐‘‡โ‰ค10001โ‰คTโ‰ค1000100โ‰ค๐‘‹,๐‘Œโ‰ค200100โ‰คX,Yโ‰ค200๐‘‹โ‰ ๐‘ŒX๎€ =YSample 1:InputOutput2150 160160 150BAExplanation:Test case 11: In this case, 150<160150<160 so Bob is taller than Alice.Test case 22: In this case, 160>150160>150 so Alice is taller than Bob.

Four friends want to attend a concert. Each ticket costs ๐‘‹X rupees.They have decided to go to the concert if and only if the total cost of the tickets does not exceed 10001000 rupees.Determine whether they will be going to the concert or not.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 integer ๐‘‹X, the cost of each ticket.Output FormatFor each test case, output YES if they will be going to the concert, NO otherwise.You can print each character in uppercase or lowercase. For example, the strings YES, yes, Yes, and yES, are all considered identical.Constraints1โ‰ค๐‘‡โ‰ค1001โ‰คTโ‰ค1001โ‰ค๐‘‹โ‰ค10001โ‰คXโ‰ค1000Sample 1:InputOutput41005002501000YESNOYESNOExplanation:Test case 11: The total cost of all tickets is 100โ‹…4=400100โ‹…4=400 which is โ‰ค1000โ‰ค1000. Thus, they will go to the concert.Test case 22: The total cost of all tickets is 500โ‹…4=2000500โ‹…4=2000 which is >1000>1000. Thus, they will not go to the concert.Test case 33: The total cost of all tickets is 250โ‹…4=1000250โ‹…4=1000 which is โ‰ค1000โ‰ค1000. Thus, they will go to the concert.Test case 44: The total cost of all tickets is 1000โ‹…4=40001000โ‹…4=4000 which is >1000>1000. Thus, they will not go to the concert.

1/2

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.