Question: Help? JAVA Sharyland high school boys decided to go on a field trip for two nights and three days. There are three types of rooms

Help? JAVA

Help? JAVA Sharyland high school boys decided to go on a field

Sharyland high school boys decided to go on a field trip for two nights and three days. There are three types of rooms in the hotel where students can stay The capacity of the room (the number of beds in the room) are given, and it is assumed that the number of rooms are unlimited. The students are assigned to these rooms, but we do not want to have any empty beds in all assigned rooms. For example, if there are three types (capacity) of the room are five (type1), nine(type2), or twelve(type3), and the entire student is 113, you can book four type1, five type2, and four type3 rooms without a bed in each room However, if the room types are like three, six, and nine for type 1, 2, and 3 respectively, and the whole student is 112, it is impossible to assign a room without an empty bed Write a program that determines if room assignments are possible so that there are no empty beds in all assigned rooms when there are three numbers representing the capacity of the three types of room and one number representing the total number of students. It is allowed to use only one type or two types of rooms without using all three types of rooms. Input and output should be through a text file. The file name should be "input.txt" and "output.txt" Input file & Output file Format A-capacity of room type 1 B-capacity of room type 2 c-capacity of room type 3 N-Total number of students Tnumber of test case s 1 or 0 Input file A B C N A BC N Output file Example Input file 5 9 12 113 3 6 9 112 Output file

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!