********************************************************************** BRONZE PROBLEMS ********************************************************************** Two problems numbered 11 through 12 ********************************************************************** Problem 11: Bovine Birthday [Traditional, 2005] Bessie asked her friend what day of the week she was born on. She knew that she was born on 2003 May 25, but didn't know what day it was. Write a program to help. Note that no cow was born earlier than the year 1800. Facts to know: * January 1, 1900 was on a Monday. * Lengths of months: Jan 31 May 31 Sep 30 Feb 28 or 29 Jun 30 Oct 31 Mar 31 Jul 31 Nov 30 Apr 30 Aug 31 Dec 31 * Every year evenly divisible by 4 is a leap year (1992 = 4*498 so 1992 will be a leap year, but the year 1990 is not a leap year) * The rule above does not hold for century years. Century years divisible by 400 are leap years, all other are not. Thus, the century years 1700, 1800, 1900 and 2100 are not leap years, but 2000 is a leap year. Do not use any built-in date functions in your computer language. PROBLEM NAME: bday INPUT FORMAT: * Line 1: Three space-separated integers that represent respectively the year, month (range 1..12), and day of a date. SAMPLE INPUT (file bday.in): 2003 5 25 INPUT DETAILS: May 25, 2003 OUTPUT FORMAT: * Line 1: A single word that is the day of the week of the specified date (from the lower-case list: monday, tuesday, wednesday, thursday, friday, saturday, sunday). SAMPLE OUTPUT (file bday.out): sunday OUTPUT DETAILS: May 2003 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 ********************************************************************** Problem 12: Max Factor [Hal Burch, 2005] To improve the organization of his farm, Farmer John labels each of his N (1 <= N <= 5,000) cows with a distinct serial number in the range 1..20,000. Unfortunately, he is unaware that the cows interpret some serial numbers as better than others. In particular, a cow whose serial number has the highest prime factor enjoys the highest social standing among all the other cows. (Recall that a prime number is just a number that has no divisors except for 1 and itself. The number 7 is prime while the number 6, being divisible by 2 and 3, is not). Given a set of N (1 <= N <= 5,000) serial numbers in the range 1..20,000, determine the one that has the largest prime factor. PROBLEM NAME: bigfact INPUT FORMAT: * Line 1: A single integer, N * Lines 2..N+1: The serial numbers to be tested, one per line SAMPLE INPUT (file bigfact.in): 4 36 38 40 42 OUTPUT FORMAT: * Line 1: The integer with the largest prime factor. If there are more than one, output the one that appears earliest in the input file. SAMPLE OUTPUT (file bigfact.out): 38 OUTPUT DETAILS: 19 is a prime factor of 38. No other input number has a larger prime factor. **********************************************************************