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