Problem 1 --------- It's March and the NCAA basketball tournament is underway. The bookies in Las Vegas (and Salt Lake City, believe it or not) are always looking for ways to better predict the outcome of upcoming games. You've decided that you'll write a program that makes predictions with enough accuracy that the betting industry will pay big bucks to purchase it (and hopefully the Mafia won't be disappointed enough to pay you a visit). The principle that your program will use is similar to the one implemented in the Magic Eight Ball toy, which is based upon cosmic rays and other random phenomena. You have decided that your program will allow the user to input a question that can be answered either "Yes!" or "No!". Your program will go through the question and count the vowels. If there are an odd number of vowels, the program will output "Yes!"; if there are an even number of vowels, the program will output "No!". Input questions will be no longer than one line, which will contain fewer than 80 characters. Vowels are defined to be upper or lower case a, e, i, o, u, and y. The only output will be one of the strings shown above followed by a return character. Your program should NOT prompt the user for a question. Here are some examples: Example 1 --------- input: Will the University of Utah win the NCAA basketball tournament? output: Yes! Example 2 --------- input: Does BYU have a basketball team? output: No! Problem 2 --------- Three brothers have a serious problem. Their grandmother loves to bake cookies for them. That's the good news. The bad news is that she bakes a different number of cookies each time, and she seals each batch in plastic. The other news is that she sends several plastic packages of cookies to them in the mail every few weeks. To complicate matters further, the three brothers are extremely jealous of one another. If one brother gets more cookies than another, they always get in a fight. Their mother, in her infinite wisdom, has decided that the brothers won't be allowed to open any cookie package unless the number of cookies inside is a multiple of three. The rest of the packages will be sent to the local homeless shelter. Although sympathetic to the needs of the homeless, the brothers are very greedy and would like to keep more of the cookies for themselves. They convince their mother to allow them to open up several cookie packages as long as the TOTAL NUMBER of cookies is a multiple of three. In order to get as many cookies as possible, the brothers decide to write a computer program that figures out how many cookies they can have. You are to write this program for them. Your program will input a list of integers corresponding to the number of cookies in 10 separate packages. It is to output the maximum number of cookies they each can have, assuming they open only packages with a total number of cookies that is a multiple of three. You may assume that each of the 10 numbers is greater than zero. Example 1 --------- input: 1 2 3 4 5 6 7 8 9 10 output: 18 Example 2 --------- input: 1 2 3 3 2 1 1 2 3 5 output: 7 Problem 3 --------- Several Avon salesmen are in the process of dividing up territory in Salt Lake City. They've decided that the simplest approach would be for each of them to be responsible for a rectangular area within the city. Rather than strictly separating their territories, however, they will allow some overlap, but they will split the proceeds of any sales in the common areas. This leaves them with the problem of determining the amount of overlap between territories. They decide to write a computer program that inputs coordinates of two rectangular areas in the city and outputs the amount of area that is common to those two rectangles. Since this is Utah, all streets are numbered relative to the Brigham Young Monument. To simplify their task, they decide to input street numbers as positive or negative integers, with north and east being positive, south and west being negative. Thus, 2100 East Street would be entered as 21, and 3000 South Street would be entered as -30. The program will input the streets on two opposite corners of each of the two rectangular areas. For each corner, the street that goes north and south will be entered first, followed by the street that goes east and west. Note that an area could be entered in four different ways, depending upon which corners are chosen and the order in which the corners are listed. For example, the area bordered by 100 South, 200 East, 3400 South, 500 West could be entered in any of the following four ways: 2 -34 -5 -1 -5 -1 2 -34 -5 -34 2 -1 2 -1 -5 -34 Your program is to output only a single integer - the number of blocks that are common to the rectangles. If the rectangles do not intersect, the program should output 0. Example 1 --------- input: 2 -34 -5 -1 0 -59 -7 -21 output: 65 Example 2 --------- input: 2 -34 -5 -1 5 -50 2 -34 output: 0 Problem 4 --------- The Acme Tiling Company has hired you to write a program that helps them order tiles for their jobs. They need to be able to draw maps of a house and use these maps to figure out how many tiles are needed to cover the floor of a room. Your program will input three things: 1. The size of the house. You may assume the house is always rectangular in shape with integer values for width and length. The width (W) dimension will precede the length (L) when input. The units of length and width are the size of the tiles, which are 1 unit square. 2. An array of characters that represents the house. This will be input as L rows of W characters. In that array, periods indicate empty spaces and |'s indicate walls. The array will be at most 30 by 30 characters. 3. The coordinates of some point in the room to be tiled. The point will be the horizontal (H) and vertical (V) distance from the upper left corner of the house. (The location of the corner is 0 0.) The horizontal distance will be input first. Your program should output the number of tiles required to fill the room. Here is an example of input: 10 8 |||||..||| |......|.| |..|...|.. ||||..|||| ....||...| |...||.... |...||...| |||||||||| 4 2 This house is 10 units wide and 8 units long. It contains 4 rooms that are not connected in any way. The room to be tiled is the one at the top of the picture, and 15 tiles will be necessary to cover the floor. Note that some of the dots are along the outside wall (indicating a door); those should be included in the space defined for a room. Note also that dots are defined to be in the same room only if they are adjacent to other dots in the room either horizontally or vertically. Dots that are only diagonally adjacent to other dots are not considered to be in the same room. Thus, the room at the lower left in the picture above is not part of the one at the top of the picture. Example 1 --------- input: 8 8 ..||||.. ..|..|.. ..|..|.. ..|..|.. ..|..|.. ..|..|.. ..|..|.. ..||||.. 3 1 output: 12 Example 2 --------- input: 8 10 .|..|.|. |.||.|.| |..|||.| |......| |..|.||| |......| |.|.||.| |...|||| .||.|... ...|||.| 1 1 output: 27 Problem 5 --------- Now that everyone has a Web page, one of the big worries in life is how to find information that we'd like to see. One way to do that is by setting up links from our own Web page to the pages of others. If there are enough links, we can go from page to page and eventually find what we're looking for. Consider the following hypothetical situation. Suppose there are 26 students in a class, all of whom have Web pages. Suppose in addition that each student is allowed to have only two links to pages of other students. Of course, they all have the maximum number of links. The problem you must solve in this question is to figure out whether or not a particular student can get to another student's Web page using only the links that have been set up. Your program will input a list of 26 student names, along with their links. The program will then input two student names and output either "Can get there." or "Can't get there.", depending upon whether or not the first student can access the second student's Web page using only the links contained in the list. For simplicity, the student names will be single upper case letters. The links will be input as lines of three names: source student followed by the destination of that student's two links. The format of the input will be three characters separated by single spaces and followed by a line feed. Although the examples listed below are in alphabetical order, the students may be listed in any order, but each will appear exactly once. The same link will not appear twice on the same student's page, nor will there be any self links. SPECIAL NOTE: If your program runs more than one minute, the judges will terminate their test. If it doesn't complete within that time, we will assume that the program is in an infinite loop. Example 1 --------- input: A B C B C D C D E D E F E F G F G H G H I H I J I H G J G F K F E L E D M D C N C B O B A P Q R Q R S R S T S T U T U V U V W V W X W X Y X Y Z Y Z A Z P Q K J output: Can get there. Example 2 --------- input: A B C B C D C D E D E F E F G F G H G H I H I J I H G J G F K F E L E D M D C N C B O B A P Q R Q R S R S T S T U T U V U V W V W X W X Y X Y Z Y Z A Z P Q J K output: Can't get there.