********************************************************************** BRONZE PROBLEMS ********************************************************************** Four problems numbered 11 through 14 ********************************************************************** Problem 11: Long Multiplication [Traditional, 2004] Given two numbers A and B (100 <= A <= 999, 100 <= B <= 999), print out the result of multiplying them together using the traditional method taught in grade school, using exactly the format below. PROBLEM NAME: mpy INPUT FORMAT: * Line 1: Two space-separated integers, A and B SAMPLE INPUT (file mpy.in): 295 573 INPUT DETAILS: A=295, B=573 OUTPUT FORMAT: * Lines 1..8: A long multiplication printed exactly like the sample output. SAMPLE OUTPUT (file mpy.out): 295 573 ------ 885 2065 1475 ------ 169035 OUTPUT DETAILS: 3 * 295 = 885; 7 * 295 = 2065; 5 * 295 = 1475 595*573 = 169035 ********************************************************************** Problem 12: Crossword Puzzles [Rob Kolstad, 1999] Consider a square crossword puzzle with N boxes in each dimension (5 <= N <= 100). Let `-' represent a blank and `#' represent a black square: ----# --##- ----- -##-- #---- A word must be at least two characters in length and contiguous as per traditional crossword puzzle rules. In this example, there are five `across' words and four `down' words. Your job is to read in a crossword puzzle and compute the number of words across and down. PROBLEM NAME: xword INPUT FORMAT: * Line 1: A single integer, N * Lines 2..N+1: Each line contains N characters, each is '#' or '-'. Successive lines describe successive rows of the crossword puzzle SAMPLE INPUT (file xword.in): 5 ----# --##- ----- -##-- #---- OUTPUT FORMAT: * Line 1: A single line with two space-separated integers: the number of 'across' words in the puzzle followed by the number of 'down' words in the puzzle SAMPLE OUTPUT (file xword.out): 5 4 ********************************************************************** Problem 13: Physics Phlunkie [Maria Plachta, 1999] Unlike the brighter bovines, Farmer John knows nothing about physics. He is incredibly confused about scientific notation and needs your help. Write a program that reads in an ordinary positive number that might well have a decimal point. Print this number in properly formatted and rounded scientific notation, showing no more than four significant digits. Presume that trailing zeroes are not significant. The output format must match the samples below exactly. SAMPLES Input Output 20000 2 x 10^4 21000 2.1 x 10^4 1234.56 1.235 x 10^3 1.2 1.2 1.200 1.2 0.098 9.8 x 10^-2 0 0 PROBLEM NAME: scino INPUT FORMAT: * Line 1: A single number, potentially with a decimal point. SAMPLE INPUT (file scino.in): 0.098 OUTPUT FORMAT: * Line 1: The number displayed in scientific notation like the samples. SAMPLE OUTPUT (file scino.out): 9.8 x 10^-2 ********************************************************************** Problem 14: Money [Traditional, 2004] In the USA, coins come in these values: 1 cent, 5 cents, 10 cents, 25 cents, 50 cents, and 100 cents. It is usually possible to create a given amount of money in many ways. One can make 15 cents in the six ways shown by this table: 1 cent 5 cent 10 cent 15 0 0 10 1 0 5 2 0 5 0 1 0 3 0 0 1 1 Given A, a number of cents (1 <= A <= 1,000,000,000), calculate the number of ways A cents can be created using the six standard coins. It is guaranteed that the number of ways will be less than 2,000,000,000 (and thus will fit into a 32-bit integer). PROBLEM NAME: money INPUT FORMAT: * Line 1: A single integer, A SAMPLE INPUT (file money.in): 15 INPUT DETAILS: 15 cents OUTPUT FORMAT: * Line 1: A single integer that is the number of ways to create the number of cents using the specified coins. SAMPLE OUTPUT (file money.out): 6 **********************************************************************