Company: Mastercard
Difficulty: medium
Sangeeta's Park Walk Problem Description Sangeeta jogs every morning. She goes to a different park every day, and always runs across the park in the same zig-zag manner that she loves. The parks can be represented as squares of size N x N. The manner in which Sangeeta runs in a 4 x 4 sized park can be represented as follows: 1 3 4 10 2 5 9 11 6 8 12 15 7 13 14 16 The values in each block are the number of minutes Sangeeta takes to arrive there from her starting point. She always starts at the top left of the park and takes one minute to move to the next block. Consider the park blocks as 0-indexed where the top left block denotes the location (0,0) and the bottom right block denotes the location (N-1, N-1). Given a park's dimensions, write a program to figure out how much time Sangeeta will take to reach a particular block in the park. Read the input from STDIN and print the output to STDOUT. Do not write arbitrary strings anywhere in the program, as these contribute to the standard ou