<PREV Problem:
NEXT>
Solved by 150 users: ...
UserDateAttemptTimeCMSC
marian26 oct 2004C++100.02445 
old117 apr 2006C++300.03497 
RAVEman05 jan 2009C++1100.02505 
tomek19 feb 2006C++400.70511 
RAVEman05 jan 2009C++800.02512 
RAVEman05 jan 2009C++900.02512 
RAVEman05 jan 2009C++700.02513 
Awk30 oct 2006C++500.19514 
RAVEman05 jan 2009C++600.02519 
old117 apr 2006C++100.03533 
tomek19 feb 2006C++500.03545 
bloodmage05 apr 2006C++100.02589 
Madiyar_Tktl19 jan 2014C++300.03613 
tourist05 nov 2007Kylix100.01621 
ethanhunt14 aug 2007C++500.03621 
ethanhunt14 aug 2007C++300.03624 
ethanhunt14 aug 2007C400.03624 
ethanhunt14 aug 2007C100.03627 
Madiyar_Tktl19 jan 2014C++200.02629 
Abzal_ktl27 dec 2007Kylix100.02630 
Languages
C++
86
FPC
44
Kylix
14
Java
6
C
4
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 

Chess Cube

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.

Input#1
a1 b2 1 1 1 1 1 1
Output#1
3 
Input#2
e2 e3 0 8 1 2 1 1
Output#2
5

Author:
III St-Peterburg school team contest, 9 December 1995. Played at MIPT contest 3 October 2004.

<PREV | Problem set | Search related messages | NEXT>


© acm.mipt DevGroup
The page was generated in 180ms

SW soft NIX
ID = 34.204.171.214