********************************************************************** BRONZE PROBLEMS ********************************************************************** Three problems numbered 11 through 13 ********************************************************************** Problem 11: DNA strings [Woburn contest, 2005] Farmer John has performed DNA sequencing on his prize milk-producing cow, Bessie. DNA sequences are ordered lists (strings) containing one or more of the letters 'A', 'C', 'G', and 'T'. As is usual for DNA sequencing, the results are a set of strings that are sequenced fragments of DNA. A pair of strings like 'GATTA' and 'TACA' most probably represent the string 'GATTACA' as the overlapping characters are merged, since they were probably duplicated in the sequencing process. Generally, merging a pair of strings involves removing the greatest overlap between the two as they are concatenated. Note that overlaps are between the end of one string and beginning of another string, not in the middle of a string. The string 'GATTACA' overlaps 'TTACA' completely, though the strings 'GATTACA' and 'TTA' have no overlap at all. Given a set of N (2 <= N <= 100) DNA sequences all of whose lengths are in the range 1..50, find and print the length of the greatest overlap between any pair of strings. PROBLEM NAME: dna INPUT FORMAT: * Line 1: A single integer N * Lines 2..N+1: Each line contains a single DNA subsequence SAMPLE INPUT (file dna.in): 4 CGCCAC TGTCGC GAATGA GAGGCGA INPUT DETAILS: Four strings; six and seven characters each OUTPUT FORMAT: * Line 1: A single line that contains the integer length of the greatest overlap between any pair of strings (in either order) SAMPLE OUTPUT (file dna.out): 3 OUTPUT DETAILS: CGC begins the first string and ends the second: CGCCAC TGTCGC so the greatest overlap is 3 ********************************************************************** Problem 12: Palindromes [Traditional, 2004] A palindrome is a series of digits (or letters, if you wish) that reads the same forwards and backwards. The number 12344321 is a palindrome, as is both 12321 and 3. The number 2468 is not a palindrome. Read a number as long as 75 digits from the input file and find the longest palindrome that occurs in the number. The palindrome will be anywhere from two digits in length all the way up to the entire number and is guaranteed to be unique. PROBLEM NAME: pal INPUT FORMAT: * Line 1: A single number up to 75 digits long SAMPLE INPUT (file pal.in): 82910341234565432158735 OUTPUT FORMAT: * Line 1: The longest palindrome anywhere in the number SAMPLE OUTPUT (file pal.out): 12345654321 OUTPUT DETAILS: 8291034-->12345654321<--58735 ********************************************************************** Problem 13: Negative Powers of Two [Traditional , 2005] Given an integer N (1 <= N <= 250), print the exact reciprocal of 2 to the Nth power. Print it in the form "0.x..." with no trailing zeroes. PROBLEM NAME: nptwo INPUT FORMAT: * Line 1: A single integer N. SAMPLE INPUT (file nptwo.in): 67 OUTPUT FORMAT: * Line 1: The decimal representation of 1 / (2^N). SAMPLE OUTPUT (file nptwo.out): 0.0000000000000000000067762635780344027125465800054371356964111328125 **********************************************************************