SRM489 Div1 Medium(500) DiceRotation
DPなどで小さなgoalx,goalyについて調べると法則が見える。
class DiceRotation{public: int theCount( int goalx, int goaly ) { int ans = 0; if ( goalx == 4 ) ans += goaly + 1; if ( goaly == 4 ) ans += goalx + 1; if ( goalx >= 2 && goaly >= 2 ) ans += 2; return ans; }};