Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Help in JAVA In McAllen theater, Seats are arranged in the N by M grid. The number of each seat is indicated by the coordinates
Help in JAVA
In McAllen theater, Seats are arranged in the N by M grid. The number of each seat is indicated by the coordinates of the corresponding grid. For example, when N3 and M-5, the seats are like below. (2,1) 2,2 (2,3) 2,4) (2,5) Many people stand in waiting lines to enter this venue. The waiting people receive the waiting list in the order 1, 2, 3, 4, from the and assign the audience to the empty seats in order like below. front. We start with (1, 1) seats for people with a waiting number, turn clockwise 3 4 5 6 7 213 14 158 1 1211 10 9 If N and M are given, a program should be created to find the seat number (x, y) to be assigned to the audience whose waiting sequence is K. If there is no seat for K, the program returns 0. Input & Output Format Tnumber of test case Input NM K Output x y x yStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started