Don't really know what you mean but here's what the program is supposed to do, all I'm after really is a point to get me started. Basically an explanation of what the program is supposed to do as I don't have a clue.
Code:
data1 contains the following :
1 1
1 5
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 0 1 2 3 4 5 6 7 8 9 -1
-1 10 11 12 13 14 15 16 17 18 19 -1
-1 20 21 22 23 24 25 26 27 28 29 -1
-1 30 31 32 33 34 35 36 37 38 39 -1
-1 40 41 42 43 44 45 46 47 48 49 -1
-1 50 51 52 53 54 55 56 57 58 59 -1
-1 60 61 62 63 64 65 66 67 68 69 -1
-1 70 71 72 73 74 75 76 77 78 79 -1
-1 80 81 82 83 84 85 86 87 88 89 -1
-1 90 91 92 93 94 95 96 97 98 99 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
$ gcc program2.c
$ a.out data1 result1
$ cat result1
The destination was reached.
Penalty accrued : 10
1 1
1 2
1 3
1 4
$
hope that helps