|Online MIPT programming contest||РУССКИЙ|
Time limit = 5 second(s)Cube is on one of square of chessboard. There are positive integers on cube sides. You should roll the cube to the desination square and get minimal penalty. Each move penalty is increased be the number that is on the down-side of the cube.
Input The initial and the destination square of the cube. Then six numbers follow: numbers on the south, north, up, right, down and left sides.
Output Your program should output minimal penalty.
a1 b2 1 1 1 1 1 1
e2 e3 0 8 1 2 1 1
III St-Peterburg school team contest, 9 December 1995. Played at MIPT contest 3 October 2004.
© acm.mipt DevGroup
The page was generated in 200ms