Bessie! bessie.X This is a warm-up problem to ensure that everyone has a starting point for all of the other problems in this lab/practice. This one counts for the contest, but not for the ACM class (since the solution code is almost given...). Bessie, our bovine hero and thematic foundation for all programming challenges, is part of a moo-relay team. Moo-relay is a race in which teams of cows send several sequences of moos as quickly as possible across long distances. Each cow in the relay, however, must produce one more moo than she received for each of the moo-sequences. Your task is to help bessie compute the correct numbers of moos! PROBLEM NAME: bessie INPUT FORMAT: * Line 1: Two integers, L and N, indicating the number of lines (L >= 1) to follow and the number of integers (N >= 1) on each line. * Lines 2..1+L: Each of these L lines contains N space-separated integers. The integers will all be nonnegative and less than 10**9. SAMPLE INPUT: 2 3 18 99 3 0 41 41 OUTPUT FORMAT: * Lines 1..L: There should be L lines of output, corresponding to the input lines 2 .. 1+L. Each output line should contain integers one larger than those in the input lines. If there are more than one integer per line, they should be space-separated, but lines should not have trailing whitespace except for the single newline that should follow all of the output lines. SAMPLE OUTPUT: 19 100 4 1 42 42 OUTPUT DETAILS: Those values are one greater than the values on the two input lines. STARTER CODE: Here, we provide starter code in each of Python, Java, and C++. All of these are ALMOST complete... you'll need to make "one" small change... This is to ensure that everyone has a starting point for the rest of the evening's problems! *** here is the text file test.in *** 2 3 18 99 3 0 41 41 *** here is the text file test.out *** 19 100 4 1 42 42 *** Python *** # here's how to run it on the file test.in: # python bessie.py < test.in # here's how to compare the results to test.out: # python bessie.py < test.in | diff - test.out # bessie.py # first line first_line = raw_input() two_strs = first_line.split() two_ints = map( int, two_strs ) num_lines = two_ints[0] num_ints = two_ints[1] # input! LINES = [] for i in range(num_lines): line = raw_input() strs = line.split() ints = map( int, strs ) LINES += [ints] # output - ALMOST! for i in range(num_lines): # end with space for n in range(num_ints-1): print LINES[i][n], # end with newline print LINES[i][num_ints-1] *** Java *** // here's how to run it on the file test.in: // javac bessie.java // first, compile... // java bessie < test.in // here's how to compare the results to test.out: // java bessie.py < test.in | diff - test.out // bessie.java import java.util.Scanner; // be sure to use the problem name as the class name public class bessie { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String next; // get first line next = sc.nextLine(); String[] strs = next.split("\\s"); int num_lines = Integer.parseInt( strs[0] ); int num_ints = Integer.parseInt( strs[1] ); int [][] MOOS = new int[num_lines][num_ints]; // input for (int i=0 ; i #include #include #include #include #include // etc. int main() { int L, N; cin >> L >> N; int** MOOS = new int*[L]; for (int i=0 ; i> MOOS[i][n]; } // output for (int i=0 ; i